GithubHelp home page GithubHelp logo

Name can't be hidden about sun-card HOT 7 CLOSED

kquinsland avatar kquinsland commented on May 30, 2024
Name can't be hidden

from sun-card.

Comments (7)

mishaaq avatar mishaaq commented on May 30, 2024

Fixed in f92431e

from sun-card.

kquinsland avatar kquinsland commented on May 30, 2024

What value should i put in my lovelace config? I do not see any code that hides the element:

    const header = this._config.name === undefined
      ? sunEntity.friendly_name || localize('domain.sun')
      : this._config.name;

If nothing is provided, a reasonable fall back is chosen, it looks like.

from sun-card.

mishaaq avatar mishaaq commented on May 30, 2024

Just remove the default value in config editor (set empty value). If an empty value is provided, the "header" slot in a card takes null value and is being omited in rendering process.

from sun-card.

kquinsland avatar kquinsland commented on May 30, 2024

I'm not using the UI editor; just YAML. See the attached screenshots. When i comment out the name: field, the default vault is present...

// Probably evaluates to true
this._config.name === undefined?

// Probably evaluates to undefined OR sun
sunEntity.friendly_name || localize('domain.sun')

// This does not become relevant because of the OR condition
      : this._config.name;  

I have put together some screenshots here that should make it clear:

https://imgur.com/a/MaYH4Lg

EDIT: I have also tried w/ the name: setting defined in YAML, but with no value and with an empty string value:

          - type: "custom:sun-card"
            # Omit the name to hide it.
            # Waiting for feedback..
            # See: https://github.com/mishaaq/sun-card/issues/11#issuecomment-568936942
            name:
            meridiem: true

and

          - type: "custom:sun-card"
            # Omit the name to hide it.
            # Waiting for feedback..
            # See: https://github.com/mishaaq/sun-card/issues/11#issuecomment-568936942
            name: ""
            meridiem: true
``

from sun-card.

mishaaq avatar mishaaq commented on May 30, 2024

Right. Try to set an empty string value in yaml therefore:
name: ""
It should work.

from sun-card.

kquinsland avatar kquinsland commented on May 30, 2024

Can you confirm that either of the two yaml snips i provided do work? If they do, then that means something else is adding the name back... and it will take some time to trace from where as the entire HA/Py code base and the JS client side would be in question/scope. I will try to put a debugger on the JS assets once i figure out how to do that :).

from sun-card.

mishaaq avatar mishaaq commented on May 30, 2024

I can confirm that both variations work (the first one with empty value is being replaced with null value after save, though).

from sun-card.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.