mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-20 06:27:01 +01:00
implemented input_boolean
This commit is contained in:
@@ -162,6 +162,9 @@ ID | Icon
|
|||||||
2 | 
|
2 | 
|
||||||
3 | 
|
3 | 
|
||||||
4 | 
|
4 | 
|
||||||
|
5 | 
|
||||||
|
6 | 
|
||||||
|
7 | 
|
||||||
|
|
||||||
|
|
||||||
# Design Guidelines for Nextion HMI Project
|
# Design Guidelines for Nextion HMI Project
|
||||||
|
|||||||
BIN
HMI/nspanel.HMI
BIN
HMI/nspanel.HMI
Binary file not shown.
BIN
HMI/nspanel.tft
BIN
HMI/nspanel.tft
Binary file not shown.
@@ -208,9 +208,15 @@ class NsPanelLovelanceUI:
|
|||||||
switch_val = 1 if entity.state == "on" else 0
|
switch_val = 1 if entity.state == "on" else 0
|
||||||
return "entityUpd,{0},{1},{2},{3},{4},{5}".format(item_nr, item_type, item, 1, name, switch_val)
|
return "entityUpd,{0},{1},{2},{3},{4},{5}".format(item_nr, item_type, item, 1, name, switch_val)
|
||||||
|
|
||||||
if item_type == "switch":
|
if item_type == "switch" or item_type == "input_boolean":
|
||||||
switch_val = 1 if entity.state == "on" else 0
|
switch_val = 1 if entity.state == "on" else 0
|
||||||
return "entityUpd,{0},{1},{2},{3},{4},{5}".format(item_nr, item_type, item, 4, name, switch_val)
|
icon_id = 4
|
||||||
|
if item_type == "input_boolean" and switch_val == 1:
|
||||||
|
icon_id = 6
|
||||||
|
else:
|
||||||
|
icon_id = 7
|
||||||
|
|
||||||
|
return "entityUpd,{0},{1},{2},{3},{4},{5}".format(item_nr, "switch", item, icon_id, name, switch_val)
|
||||||
|
|
||||||
if item_type == "sensor":
|
if item_type == "sensor":
|
||||||
icon_id = 0
|
icon_id = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user