Merge branch 'main' into pr/179

This commit is contained in:
joBr99
2022-05-06 17:51:23 +02:00
12 changed files with 24 additions and 16 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

Binary file not shown.

Binary file not shown.

View File

@@ -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

View File

@@ -182,7 +182,10 @@ class LuiController(object):
self._ha_api.turn_off(entity_id)
if button_type == "number-set":
self._ha_api.get_entity(entity_id).call_service("set_value", value=value)
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
if button_type == "up":

View File

@@ -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":

View File

@@ -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