-
Notifications
You must be signed in to change notification settings - Fork 278
State #9
Comments
You might be confusing state map with actual state i.e.
and
|
@VPNMASTER Please show an example of tile config |
|
The state function works only If I remove the states mapping |
There was two separate elements that was able to show different states. Now it's only one, and states map have bigger priority. Though you still can handle in the state callback function. Something like: state: function (item, entity) {
if('brightness' in entity.attributes) {
return switchPercents('brightness', 255, true)(item, entity);
}
return ({on: "On", off: "Off"})[entity.state];
}, |
Yes, finally I end up with doing this way. |
It's only look that way, in fact there was two elements and the second one overlap the first. So second one showed only when |
I think that |
So there's no problem to fallback into .state when states[entity.state] is null, but in fact it's never null in this case. |
Sorry, I meant the return of anonymous function and not the entity.state |
Oh yes, i got it. I'm looking into changing priorities from states->state to state->states., probably that should solve the problem, in this case. |
@VPNMASTER I've pushed new version, please try it out |
Thank you guys. Works like a charm |
New state attribute is not working if I define the states mapping.
I think the previous behavior was better.
The text was updated successfully, but these errors were encountered: