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
|
Vertical Alignment : center
|
||||||
Input Type : character
|
Input Type : character
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 50
|
Max. Text Size : 80
|
||||||
Word wrap : disabled
|
Word wrap : disabled
|
||||||
Horizontal Spacing : 0
|
Horizontal Spacing : 0
|
||||||
Vertical Spacing : 0
|
Vertical Spacing : 0
|
||||||
@@ -87,7 +87,7 @@ Text tTmp2
|
|||||||
Vertical Alignment : center
|
Vertical Alignment : center
|
||||||
Input Type : character
|
Input Type : character
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 50
|
Max. Text Size : 80
|
||||||
Word wrap : disabled
|
Word wrap : disabled
|
||||||
Horizontal Spacing : 0
|
Horizontal Spacing : 0
|
||||||
Vertical Spacing : 0
|
Vertical Spacing : 0
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ Variable (string) entn
|
|||||||
Attributes
|
Attributes
|
||||||
ID : 21
|
ID : 21
|
||||||
Scope : local
|
Scope : local
|
||||||
Text : newtxt
|
Text :
|
||||||
Max. Text Size: 50
|
Max. Text Size: 80
|
||||||
|
|
||||||
Variable (int32) mode
|
Variable (int32) mode
|
||||||
Attributes
|
Attributes
|
||||||
|
|||||||
@@ -56,8 +56,8 @@ Variable (string) entn
|
|||||||
Attributes
|
Attributes
|
||||||
ID : 18
|
ID : 18
|
||||||
Scope : local
|
Scope : local
|
||||||
Text : newtxt
|
Text :
|
||||||
Max. Text Size: 50
|
Max. Text Size: 80
|
||||||
|
|
||||||
Text tEntity
|
Text tEntity
|
||||||
Attributes
|
Attributes
|
||||||
@@ -322,7 +322,7 @@ Slider hPosition
|
|||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
crcputh 55 bb
|
crcputh 55 bb
|
||||||
crcputs sys0,1
|
crcputs sys0,2
|
||||||
crcputs tSend.txt,0
|
crcputs tSend.txt,0
|
||||||
//send cmd
|
//send cmd
|
||||||
printh 55 bb
|
printh 55 bb
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ Text tTmp1
|
|||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Associated Keyboard : none
|
Associated Keyboard : none
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 50
|
Max. Text Size : 80
|
||||||
|
|
||||||
Text tTmp2
|
Text tTmp2
|
||||||
Attributes
|
Attributes
|
||||||
@@ -40,7 +40,7 @@ Text tTmp2
|
|||||||
Send Component ID : disabled
|
Send Component ID : disabled
|
||||||
Associated Keyboard : none
|
Associated Keyboard : none
|
||||||
Text :
|
Text :
|
||||||
Max. Text Size : 50
|
Max. Text Size : 80
|
||||||
|
|
||||||
Picture p0
|
Picture p0
|
||||||
Attributes
|
Attributes
|
||||||
|
|||||||
@@ -59,8 +59,8 @@ Variable (string) strCommand
|
|||||||
Variable (string) entn
|
Variable (string) entn
|
||||||
Attributes
|
Attributes
|
||||||
Scope : local
|
Scope : local
|
||||||
Text : newtxt
|
Text :
|
||||||
Max. Text Size: 50
|
Max. Text Size: 80
|
||||||
|
|
||||||
Variable (int32) mode
|
Variable (int32) mode
|
||||||
Attributes
|
Attributes
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ Variable (string) strCommand
|
|||||||
Variable (string) entn
|
Variable (string) entn
|
||||||
Attributes
|
Attributes
|
||||||
Scope : local
|
Scope : local
|
||||||
Text : newtxt
|
Text :
|
||||||
Max. Text Size: 50
|
Max. Text Size: 80
|
||||||
|
|
||||||
Text tEntity
|
Text tEntity
|
||||||
Attributes
|
Attributes
|
||||||
@@ -147,7 +147,7 @@ Slider hPosition
|
|||||||
btlen tSend.txt,sys0
|
btlen tSend.txt,sys0
|
||||||
crcrest 1,0xffff // reset CRC
|
crcrest 1,0xffff // reset CRC
|
||||||
crcputh 55 bb
|
crcputh 55 bb
|
||||||
crcputs sys0,1
|
crcputs sys0,2
|
||||||
crcputs tSend.txt,0
|
crcputs tSend.txt,0
|
||||||
//send cmd
|
//send cmd
|
||||||
printh 55 bb
|
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
|
## 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
|
- 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)
|
- Detail Pages for Lights (Brightness, Temperature and Color of the Light) and for Covers (Position)
|
||||||
- Thermostat Page
|
- Thermostat Page
|
||||||
|
|||||||
@@ -182,6 +182,9 @@ class LuiController(object):
|
|||||||
self._ha_api.turn_off(entity_id)
|
self._ha_api.turn_off(entity_id)
|
||||||
|
|
||||||
if button_type == "number-set":
|
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)
|
self._ha_api.get_entity(entity_id).call_service("set_value", value=value)
|
||||||
|
|
||||||
# for shutter / covers
|
# for shutter / covers
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ def map_to_mdi_name(ha_type, state=None, device_class=None):
|
|||||||
return "ray-vertex"
|
return "ray-vertex"
|
||||||
if ha_type == "light":
|
if ha_type == "light":
|
||||||
return "lightbulb"
|
return "lightbulb"
|
||||||
|
if ha_type == "fan":
|
||||||
|
return "fan"
|
||||||
if ha_type == "input_boolean":
|
if ha_type == "input_boolean":
|
||||||
return "check-circle-outline" if state == "on" else "close-circle-outline"
|
return "check-circle-outline" if state == "on" else "close-circle-outline"
|
||||||
if ha_type == "cover":
|
if ha_type == "cover":
|
||||||
|
|||||||
@@ -181,6 +181,9 @@ class LuiPagesGen(object):
|
|||||||
min_v = entity.attributes.get("min", 0)
|
min_v = entity.attributes.get("min", 0)
|
||||||
max_v = entity.attributes.get("max", 100)
|
max_v = entity.attributes.get("max", 100)
|
||||||
return f"~number~{entityId}~{icon_id}~17299~{name}~{entity.state}|{min_v}|{max_v}"
|
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":
|
if entityType == "input_text":
|
||||||
icon_id = get_icon_id_ha("input_text", overwrite=icon)
|
icon_id = get_icon_id_ha("input_text", overwrite=icon)
|
||||||
value = entity.state
|
value = entity.state
|
||||||
|
|||||||
Reference in New Issue
Block a user