Closed kquinsland closed 4 years ago
Fixed in f92431e9bfea2d1f3171e3c7d6316a6a188accc2
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.
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.
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:
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
``
Right. Try to set an empty string value in yaml therefore:
name: ""
It should work.
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 :).
I can confirm that both variations work (the first one with empty value is being replaced with null value after save, though).
Describe the bug The
name:
field is optional, but blank or unset values do not hide the name from the cardTo Reproduce
name:
property toFalse
or comment it out entirely in the configSun
still showing up on the card.Expected behavior I would expect that a value of
False
or an unset value would hide the label/name from the cardAdditional context I am trying to achieve a dense lovelace UI for a project. Every vertical pixel matters and i would like to reclaim the pixels that the
name:
takes up.