mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-18 10:57:01 +01:00
Fix state / state_not logic error for entities (#637)
According to the documentation, an entity is only displayed * if `state` is set: if the entity state is equal to the `state` value * if `state_not` is set: if the entity state is _not_ equal to the `state_not` value So `""` – an **empty** string – shall only be returned – i.e. the **entity be hidden** * if `state` is set: if the entity state is **not** equal to the `state` value * if `state_not` is set: if the entity state is equal to the `state_not` value Co-authored-by: Daniel Albert <esclear@users.noreply.github.com>
This commit is contained in:
@@ -256,9 +256,9 @@ class LuiPagesGen(object):
|
|||||||
# HA Entities
|
# HA Entities
|
||||||
entity = apis.ha_api.get_entity(entityId)
|
entity = apis.ha_api.get_entity(entityId)
|
||||||
# check state for if a condition is defined
|
# check state for if a condition is defined
|
||||||
if item.condState is not None and item.condState == entity.state:
|
if item.condState is not None and item.condState != entity.state:
|
||||||
return ""
|
return ""
|
||||||
if item.condStateNot is not None and item.condStateNot != entity.state:
|
if item.condStateNot is not None and item.condStateNot == entity.state:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
# common res vars
|
# common res vars
|
||||||
|
|||||||
Reference in New Issue
Block a user