mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-01-07 15:15:48 +01:00
Fix input_boolean and switch
This commit is contained in:
@@ -509,14 +509,15 @@ class NsPanelLovelaceUI:
|
|||||||
|
|
||||||
if item_type == "switch" or item_type == "input_boolean":
|
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
|
||||||
icon_id = get_icon_id("flash")
|
icon_id = get_icon_id('flash') if icon is None else get_icon_id(icon)
|
||||||
icon_color = self.getEntityColor(entity)
|
icon_color = self.getEntityColor(entity)
|
||||||
if item_type == "input_boolean":
|
|
||||||
if switch_val == 1:
|
if item_type == "input_boolean":
|
||||||
icon_id = get_icon_id("check-circle-outline")
|
if switch_val == 1:
|
||||||
else:
|
icon_id = get_icon_id("check-circle-outline")
|
||||||
icon_id = get_icon_id("close-circle-outline")
|
else:
|
||||||
return f",switch,{item},{icon_id},{icon_color},{name},{switch_val}"
|
icon_id = get_icon_id("close-circle-outline")
|
||||||
|
return f",switch,{item},{icon_id},{icon_color},{name},{switch_val}"
|
||||||
|
|
||||||
if item_type == "sensor":
|
if item_type == "sensor":
|
||||||
# maps ha device classes to material design icons
|
# maps ha device classes to material design icons
|
||||||
|
|||||||
Reference in New Issue
Block a user