resoai / TileBoard

A simple yet highly configurable Dashboard for HomeAssistant
MIT License
1.63k stars 278 forks source link

Tileboard not use `states` dict if `state` is a function #723

Closed notabene00 closed 3 years ago

notabene00 commented 3 years ago

if defined

states: {
    'home': 'Дома',
    'not_home': 'Не дома'
},

and

state: function(i, e) {
    return 'home';
}

then state field will contain home, not Дома

alphasixtyfive commented 3 years ago

This is by design. While states maps actual state from the entity, state overrides everything and sets it to whatever you return.

notabene00 commented 3 years ago

So I should define my own dict or smth inside of function Got it