mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-14 17:08:17 +01:00
implements #652
This commit is contained in:
@@ -17,6 +17,7 @@ class Entity(object):
|
|||||||
self.status = entity_input_config.get("status")
|
self.status = entity_input_config.get("status")
|
||||||
self.condState = entity_input_config.get("state")
|
self.condState = entity_input_config.get("state")
|
||||||
self.condStateNot = entity_input_config.get("state_not")
|
self.condStateNot = entity_input_config.get("state_not")
|
||||||
|
self.condTemplate = entity_input_config.get("state_template")
|
||||||
self.assumedState = entity_input_config.get("assumed_state", False)
|
self.assumedState = entity_input_config.get("assumed_state", False)
|
||||||
self.data = entity_input_config.get("data", {})
|
self.data = entity_input_config.get("data", {})
|
||||||
self.entity_input_config = entity_input_config
|
self.entity_input_config = entity_input_config
|
||||||
|
|||||||
@@ -229,6 +229,8 @@ class LuiPagesGen(object):
|
|||||||
return ""
|
return ""
|
||||||
if item.condStateNot is not None and item.condStateNot == state:
|
if item.condStateNot is not None and item.condStateNot == state:
|
||||||
return ""
|
return ""
|
||||||
|
if item.condTemplate is not None and apis.ha_api.render_template(item.condTemplate):
|
||||||
|
return ""
|
||||||
|
|
||||||
# Internal types
|
# Internal types
|
||||||
if entityType == "delete":
|
if entityType == "delete":
|
||||||
|
|||||||
@@ -88,6 +88,15 @@ This sensor will only be shown on the card if it's state is not equal to `on`
|
|||||||
state_not: "on"
|
state_not: "on"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Hide item based on HA Template
|
||||||
|
|
||||||
|
The template must evaluate to `true` for the entity to hide.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- entity: binary_sensor.sensor_kueche_contact
|
||||||
|
state_template: '{{ state_attr("sun.sun","azimuth") < 200 }}'
|
||||||
|
```
|
||||||
|
|
||||||
## Calling service directly as button
|
## Calling service directly as button
|
||||||
|
|
||||||
The following example shows how to call services directly, this enables you to call services on entities not (yet) supported by the backend and also to pass data to services.
|
The following example shows how to call services directly, this enables you to call services on entities not (yet) supported by the backend and also to pass data to services.
|
||||||
|
|||||||
Reference in New Issue
Block a user