implemented input_boolean

This commit is contained in:
joBr99
2022-03-06 16:02:41 +01:00
parent eb3491121f
commit 84cc9e5d95
4 changed files with 11 additions and 2 deletions

View File

@@ -162,6 +162,9 @@ ID | Icon
2 | ![thermometer](https://raw.githubusercontent.com/Templarian/MaterialDesign-SVG/0aeb4d612644d80d9d1fe242f705f362985de5dc/svg/thermometer.svg)
3 | ![gesture-tap-button](https://raw.githubusercontent.com/Templarian/MaterialDesign-SVG/0aeb4d612644d80d9d1fe242f705f362985de5dc/svg/gesture-tap-button.svg)
4 | ![flash](https://raw.githubusercontent.com/Templarian/MaterialDesign-SVG/0aeb4d612644d80d9d1fe242f705f362985de5dc/svg/flash.svg)
5 | ![music](https://raw.githubusercontent.com/Templarian/MaterialDesign-SVG/0aeb4d612644d80d9d1fe242f705f362985de5dc/svg/music.svg)
6 | ![check-circle-outline](https://raw.githubusercontent.com/Templarian/MaterialDesign-SVG/0aeb4d612644d80d9d1fe242f705f362985de5dc/svg/check-circle-outline.svg)
7 | ![close-circle-outline](https://raw.githubusercontent.com/Templarian/MaterialDesign-SVG/0aeb4d612644d80d9d1fe242f705f362985de5dc/svg/close-circle-outline.svg)
# Design Guidelines for Nextion HMI Project

Binary file not shown.

Binary file not shown.

View File

@@ -208,9 +208,15 @@ class NsPanelLovelanceUI:
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)
if item_type == "switch":
if item_type == "switch" or item_type == "input_boolean":
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":
icon_id = 0