mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-21 15:04:24 +01:00
Merge branch 'main' into pr/179
This commit is contained in:
@@ -57,7 +57,7 @@ Text tTmp1
|
||||
Vertical Alignment : center
|
||||
Input Type : character
|
||||
Text :
|
||||
Max. Text Size : 50
|
||||
Max. Text Size : 80
|
||||
Word wrap : disabled
|
||||
Horizontal Spacing : 0
|
||||
Vertical Spacing : 0
|
||||
@@ -87,7 +87,7 @@ Text tTmp2
|
||||
Vertical Alignment : center
|
||||
Input Type : character
|
||||
Text :
|
||||
Max. Text Size : 50
|
||||
Max. Text Size : 80
|
||||
Word wrap : disabled
|
||||
Horizontal Spacing : 0
|
||||
Vertical Spacing : 0
|
||||
|
||||
@@ -69,8 +69,8 @@ Variable (string) entn
|
||||
Attributes
|
||||
ID : 21
|
||||
Scope : local
|
||||
Text : newtxt
|
||||
Max. Text Size: 50
|
||||
Text :
|
||||
Max. Text Size: 80
|
||||
|
||||
Variable (int32) mode
|
||||
Attributes
|
||||
|
||||
@@ -56,8 +56,8 @@ Variable (string) entn
|
||||
Attributes
|
||||
ID : 18
|
||||
Scope : local
|
||||
Text : newtxt
|
||||
Max. Text Size: 50
|
||||
Text :
|
||||
Max. Text Size: 80
|
||||
|
||||
Text tEntity
|
||||
Attributes
|
||||
@@ -322,7 +322,7 @@ Slider hPosition
|
||||
btlen tSend.txt,sys0
|
||||
crcrest 1,0xffff // reset CRC
|
||||
crcputh 55 bb
|
||||
crcputs sys0,1
|
||||
crcputs sys0,2
|
||||
crcputs tSend.txt,0
|
||||
//send cmd
|
||||
printh 55 bb
|
||||
|
||||
@@ -30,7 +30,7 @@ Text tTmp1
|
||||
Send Component ID : disabled
|
||||
Associated Keyboard : none
|
||||
Text :
|
||||
Max. Text Size : 50
|
||||
Max. Text Size : 80
|
||||
|
||||
Text tTmp2
|
||||
Attributes
|
||||
@@ -40,7 +40,7 @@ Text tTmp2
|
||||
Send Component ID : disabled
|
||||
Associated Keyboard : none
|
||||
Text :
|
||||
Max. Text Size : 50
|
||||
Max. Text Size : 80
|
||||
|
||||
Picture p0
|
||||
Attributes
|
||||
|
||||
@@ -59,8 +59,8 @@ Variable (string) strCommand
|
||||
Variable (string) entn
|
||||
Attributes
|
||||
Scope : local
|
||||
Text : newtxt
|
||||
Max. Text Size: 50
|
||||
Text :
|
||||
Max. Text Size: 80
|
||||
|
||||
Variable (int32) mode
|
||||
Attributes
|
||||
|
||||
@@ -46,8 +46,8 @@ Variable (string) strCommand
|
||||
Variable (string) entn
|
||||
Attributes
|
||||
Scope : local
|
||||
Text : newtxt
|
||||
Max. Text Size: 50
|
||||
Text :
|
||||
Max. Text Size: 80
|
||||
|
||||
Text tEntity
|
||||
Attributes
|
||||
@@ -147,7 +147,7 @@ Slider hPosition
|
||||
btlen tSend.txt,sys0
|
||||
crcrest 1,0xffff // reset CRC
|
||||
crcputh 55 bb
|
||||
crcputs sys0,1
|
||||
crcputs sys0,2
|
||||
crcputs tSend.txt,0
|
||||
//send cmd
|
||||
printh 55 bb
|
||||
|
||||
BIN
HMI/nspanel.HMI
BIN
HMI/nspanel.HMI
Binary file not shown.
BIN
HMI/nspanel.tft
BIN
HMI/nspanel.tft
Binary file not shown.
@@ -18,7 +18,7 @@ NsPanel needs to be flashed with Tasmota (or upcoming with ESPHome)
|
||||
|
||||
## Features
|
||||
|
||||
- Entities Page with support for cover, switch, input_boolean, binary_sensor, sensor, button, number, scenes, script, input_button and light, input_text (read-only), lock
|
||||
- Entities Page with support for cover, switch, input_boolean, binary_sensor, sensor, button, number, scenes, script, input_button and light, input_text (read-only), lock, fan
|
||||
- Grid Page with support for cover, switch, input_boolean, button, scenes, light and lock
|
||||
- Detail Pages for Lights (Brightness, Temperature and Color of the Light) and for Covers (Position)
|
||||
- Thermostat Page
|
||||
|
||||
@@ -182,6 +182,9 @@ class LuiController(object):
|
||||
self._ha_api.turn_off(entity_id)
|
||||
|
||||
if button_type == "number-set":
|
||||
if entity_id.startswith('fan'):
|
||||
self._ha_api.get_entity(entity_id).call_service("set_percentage", percentage=value)
|
||||
else:
|
||||
self._ha_api.get_entity(entity_id).call_service("set_value", value=value)
|
||||
|
||||
# for shutter / covers
|
||||
|
||||
@@ -47,6 +47,8 @@ def map_to_mdi_name(ha_type, state=None, device_class=None):
|
||||
return "ray-vertex"
|
||||
if ha_type == "light":
|
||||
return "lightbulb"
|
||||
if ha_type == "fan":
|
||||
return "fan"
|
||||
if ha_type == "input_boolean":
|
||||
return "check-circle-outline" if state == "on" else "close-circle-outline"
|
||||
if ha_type == "cover":
|
||||
|
||||
@@ -181,6 +181,9 @@ class LuiPagesGen(object):
|
||||
min_v = entity.attributes.get("min", 0)
|
||||
max_v = entity.attributes.get("max", 100)
|
||||
return f"~number~{entityId}~{icon_id}~17299~{name}~{entity.state}|{min_v}|{max_v}"
|
||||
if entityType == "fan":
|
||||
icon_id = get_icon_id_ha("fan", overwrite=icon)
|
||||
return f"~number~{entityId}~{icon_id}~17299~{name}~{entity.percentage}|0|100"
|
||||
if entityType == "input_text":
|
||||
icon_id = get_icon_id_ha("input_text", overwrite=icon)
|
||||
value = entity.state
|
||||
|
||||
Reference in New Issue
Block a user