Compare commits

...

15 Commits

Author SHA1 Message Date
Johannes Braun
529b0516f4 implementes #539 2022-12-25 15:43:23 +01:00
Johannes
b9504a2ff0 fixes #631 2022-12-25 10:32:45 +01:00
Johannes
b4b988b735 fixes #630 2022-12-24 23:47:02 +01:00
Johannes
d3ab908507 Update issue-close-app.yml 2022-12-24 22:54:14 +01:00
Johannes
2ee79debd0 Update card-climate.md 2022-12-24 00:44:07 +01:00
Johannes
d536957255 bump required berry driver version 2022-12-23 22:22:37 +01:00
Johannes
b4fe08ba43 bump berry driver version to 7 2022-12-23 22:16:20 +01:00
Johannes Braun
e4a4917932 add some delay during flashing 2022-12-23 21:39:54 +01:00
Johannes Braun
d17f8c636c Merge branch 'main' of github.com:joBr99/nspanel-lovelace-ui 2022-12-23 21:19:14 +01:00
Johannes Braun
9fc6ccf901 add updated beta locacles json 2022-12-23 21:18:58 +01:00
joBr99
4f760da1aa Merge branch 'main' of github.com:joBr99/nspanel-lovelace-ui (add nextion2text) 2022-12-23 15:58:47 +00:00
Johannes Braun
ac2df9e431 Merge branch 'main' of github.com:joBr99/nspanel-lovelace-ui 2022-12-23 16:55:26 +01:00
Johannes Braun
cd4d68d590 added bigger icons for us-p 2022-12-23 16:55:05 +01:00
Armilar
2fd5363131 v3.7.0 (Breaking Changes)
* Move Config "active" to DP activeBrightness and add DP activeDimmodeBrightness
* Change weather icons for exceptional (window-close)
* Add DasWetter / Add DasWetter in create AutoAlias / Const MinMax
* Add cardChart on PROD (implemented but working with v3.7.0 --> next TFT)
* Add Shuffle to Media Player
* Remove Old Speakerlist and Add 5 GridCard Control PageItems
* Add In_Sel PopUp to cardMedia
* Add alternate MRIcon Size
* Add popUpTimer / New ALIAS Type level.timer
* Add Fan / New ALIAS Type level.mode.fan
* Add InSel - InputSelector with Alias Type buttonSensor (Datapoint .VALUE)
2022-12-23 16:11:14 +01:00
Armilar
c2df6a953a v3.7.0 (Breaking Changes)
* Move Config "active" to DP activeBrightness and add DP activeDimmodeBrightness
* Change weather icons for exceptional (window-close)
* Add DasWetter / Add DasWetter in create AutoAlias / Const MinMax
* Add cardChart on PROD (implemented but working with v3.7.0 --> next TFT)
* Add Shuffle to Media Player
* Remove Old Speakerlist and Add 5 GridCard Control PageItems
* Add In_Sel PopUp to cardMedia
* Add alternate MRIcon Size
* Add popUpTimer / New ALIAS Type level.timer
* Add Fan / New ALIAS Type level.mode.fan
* Add InSel - InputSelector with Alias Type buttonSensor (Datapoint .VALUE)
2022-12-23 16:07:13 +01:00
16 changed files with 4462 additions and 270 deletions

View File

@@ -5,10 +5,10 @@
# Comment that will be sent if an issue is judged to be closed.
comment: >-
This issue has been automatically closed because the TEMPLATE is missing or incomplete.
This issue has been automatically closed because the TEMPLATE (it's the stuff you deleted from the issue while opening) is missing or incomplete.
Filling the template is required so standard questions don't need to be asked again each time.
THe ability to provide assistance is greatly hampered if few minutes are not taken to complete the issue template
The ability to provide assistance is greatly hampered if few minutes are not taken to complete the issue template
with the requested information. The details requested potentially affect which options to pursue. The small amount
of time you will spend completing the template will also help the volunteers, providing assistance to you, to reduce
the time required to help you.
@@ -19,14 +19,16 @@ comment: >-
[Docs](https://docs.nspanel.pky.eu) for more information.
IF YOU THINK THIS IS WAS CLOSED AS A FALSE POSITIVE or you just didn't find a template that matches your request, please do not open another issue, closed issues will also be monitored.
issueConfigs:
# There can be several configs for different kind of issues.
- content:
# template 1: bug report
- "PROBLEM DESCRIPTION"
# - "REQUESTED INFORMATION"
# - "TO REPRODUCE"
# - "EXPECTED BEHAVIOUR"
- "REQUESTED INFORMATION"
- "TO REPRODUCE"
- "EXPECTED BEHAVIOUR"
- content:
# template 2: feature request
- "FEATURE DESCRIPTION"

View File

@@ -1,4 +1,4 @@
+++ /dev/fd/62 2022-12-21 20:15:25.252534958 +0000
+++ /dev/fd/62 2022-12-23 15:58:39.712878570 +0000
+I/n2t-out/Program.s.txt
++ HMI/US/portrait/n2t-out/Program.s.txt
+I/n2t-out/cardEntities.txt

View File

@@ -30,6 +30,10 @@ pageStartup
19 Component(s)
181 Line(s) of event code
129 Unique line(s) of event code
screensaver
45 Component(s)
410 Line(s) of event code
298 Unique line(s) of event code
popupShutter
25 Component(s)
398 Line(s) of event code
@@ -50,10 +54,6 @@ cardMedia
57 Component(s)
660 Line(s) of event code
325 Unique line(s) of event code
screensaver
45 Component(s)
410 Line(s) of event code
298 Unique line(s) of event code
cardQR
32 Component(s)
425 Line(s) of event code

View File

@@ -126,9 +126,9 @@ Text t10
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 49
y coordinate : 240
Width : 225
x coordinate : 53
y coordinate : 245
Width : 215
Height : 2
Effect : load
Effect Priority : 0
@@ -576,10 +576,10 @@ Text tIcon1
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 8
x coordinate : 0
y coordinate : 227
Width : 33
Height : 30
Width : 45
Height : 45
Effect : load
Effect Priority : 0
Effect Time : 300
@@ -589,7 +589,7 @@ Text tIcon1
Font ID : 1
Back. Color : 0
Font Color : 17299
Horizontal Alignment : center
Horizontal Alignment : left
Vertical Alignment : center
Input Type : character
Text :
@@ -606,10 +606,10 @@ Text tIcon2
Disable release event after dragging: 0
Send Component ID : disabled
Opacity : 127
x coordinate : 282
x coordinate : 275
y coordinate : 227
Width : 33
Height : 30
Width : 45
Height : 45
Effect : load
Effect Priority : 0
Effect Time : 300
@@ -619,7 +619,7 @@ Text tIcon2
Font ID : 1
Back. Color : 0
Font Color : 17299
Horizontal Alignment : center
Horizontal Alignment : right
Vertical Alignment : center
Input Type : character
Text :
@@ -817,7 +817,7 @@ Text tNotifyHead
Send Component ID : disabled
Opacity : 127
x coordinate : 0
y coordinate : 257
y coordinate : 272
Width : 320
Height : 58
Effect : load
@@ -847,7 +847,7 @@ Text tNotifyText
Send Component ID : disabled
Opacity : 127
x coordinate : 0
y coordinate : 315
y coordinate : 330
Width : 320
Height : 58
Effect : load

Binary file not shown.

Binary file not shown.

View File

@@ -3,19 +3,65 @@ import json
from collections import defaultdict
keys = {
'frontend.ui.card.light.brightness': 'lights.Brightness',
# 'frontend.ui.card.light.brightness': 'lights.Color',
'frontend.ui.card.light.color_temperature': 'lights.Temperature',
'backend.component.binary_sensor.state.window.off': 'window.closed',
'backend.component.binary_sensor.state.window.on': 'window.opened',
'backend.component.binary_sensor.state.door.off': 'door.closed',
'backend.component.binary_sensor.state.door.on': 'door.opened',
'frontend.ui.card.lock.lock': 'lock.LOCK',
'frontend.ui.card.lock.unlock': 'lock.UNLOCK',
'frontend.ui.card.cover.position': 'blinds.Position',
'frontend.ui.card.climate.currently': 'thermostat.Currently',
'frontend.ui.panel.config.devices.entities.state': 'thermostat.State',
'frontend.ui.card.climate.operation': 'thermostat.Action',
'frontend.ui.card.light.brightness': 'lights.Brightness',
'frontend.ui.card.light.color_temperature': 'lights.Temperature',
'backend.component.binary_sensor.state.window.off': 'window.closed',
'backend.component.binary_sensor.state.window.on': 'window.opened',
'backend.component.binary_sensor.state.door.off': 'door.closed',
'backend.component.binary_sensor.state.door.on': 'door.opened',
'frontend.ui.card.lock.lock': 'lock.LOCK',
'frontend.ui.card.lock.unlock': 'lock.UNLOCK',
'frontend.ui.card.cover.position': 'blinds.Position',
'frontend.ui.card.climate.currently': 'thermostat.Currently',
'frontend.ui.panel.config.devices.entities.state': 'thermostat.State',
'frontend.ui.card.climate.operation': 'thermostat.Action',
'frontend.ui.card.button.press': 'button.press',
'frontend.ui.card.script.run': 'script.run',
'frontend.ui.card.scene.activate': 'scene.activate',
'frontend.ui.card.vacuum.actions.start_cleaning': 'vacuum.start_cleaning',
'frontend.ui.card.vacuum.actions.return_to_base': 'vacuum.return_to_base',
'frontend.ui.card.cover.tilt_position': 'blinds.tilt_position',
'frontend.ui.card.fan.speed': 'fan.speed',
'frontend.ui.card.timer.actions.start': 'timer.start',
'frontend.ui.card.timer.actions.pause': 'timer.pause',
'frontend.ui.card.timer.actions.cancel': 'timer.cancel',
'frontend.ui.card.timer.actions.finish': 'timer.finish',
'frontend.state_badge.alarm_control_panel.armed': 'alarm_control_panel.armed',
'frontend.state_badge.alarm_control_panel.armed_away': 'alarm_control_panel.armed_away',
'frontend.state_badge.alarm_control_panel.armed_custom_bypass': 'alarm_control_panel.armed_custom_bypass',
'frontend.state_badge.alarm_control_panel.armed_home': 'alarm_control_panel.armed_home',
'frontend.state_badge.alarm_control_panel.armed_night': 'alarm_control_panel.armed_night',
'frontend.state_badge.alarm_control_panel.armed_vacation': 'alarm_control_panel.armed_vacation',
'frontend.state_badge.alarm_control_panel.arming': 'alarm_control_panel.arming',
'frontend.state_badge.alarm_control_panel.disarmed': 'alarm_control_panel.disarmed',
'frontend.state_badge.alarm_control_panel.disarming': 'alarm_control_panel.disarming',
'frontend.state_badge.alarm_control_panel.pending': 'alarm_control_panel.pending',
'frontend.state_badge.alarm_control_panel.triggered': 'alarm_control_panel.triggered',
'frontend.state_attributes.climate.hvac_action.cooling': 'hvac_action.cooling',
'frontend.state_attributes.climate.hvac_action.drying': 'hvac_action.drying',
'frontend.state_attributes.climate.hvac_action.fan': 'hvac_action.fan',
'frontend.state_attributes.climate.hvac_action.heating': 'hvac_action.heating',
'frontend.state_attributes.climate.hvac_action.idle': 'hvac_action.idle',
'frontend.state_attributes.climate.hvac_action.off': 'hvac_action.off',
'frontend.ui.card.alarm_control_panel.arm_away': 'alarm_control_panel.arm_away',
'frontend.ui.card.alarm_control_panel.arm_custom_bypass': 'alarm_control_panel.arm_custom_bypass',
'frontend.ui.card.alarm_control_panel.arm_home': 'alarm_control_panel.arm_home',
'frontend.ui.card.alarm_control_panel.arm_night': 'alarm_control_panel.arm_night',
'frontend.ui.card.alarm_control_panel.arm_vacation': 'alarm_control_panel.arm_vacation',
'frontend.ui.card.alarm_control_panel.clear_code': 'alarm_control_panel.clear_code',
'frontend.ui.card.alarm_control_panel.code': 'alarm_control_panel.code',
'frontend.ui.card.alarm_control_panel.disarm': 'alarm_control_panel.disarm',
'backend.component.climate.state._.off': 'climate.off',
'backend.component.climate.state._.heat': 'climate.heat',
'backend.component.climate.state._.cool': 'climate.cool',
'backend.component.climate.state._.heat_cool': 'climate.heat_cool',
'backend.component.climate.state._.auto': 'climate.auto',
'backend.component.climate.state._.dry': 'climate.dry',
'backend.component.climate.state._.fan_only': 'climate.fan_only',
'backend.component.timer.state._.active': 'timer.active',
'backend.component.timer.state._.idle': 'timer.idle',
'backend.component.timer.state._.paused': 'timer.paused',
}
@@ -51,7 +97,8 @@ def lookup(path_frontend_file, path_backend_file, lookupstr):
if k in res:
res = res[k]
if type(res) is not str:
print("Warning result is not a String")
print(f"Warning result is not a String: {lookupstr}")
res = ""
return res
def get_translation(locale, lookupstr):
@@ -69,5 +116,5 @@ for src, dst in keys.items():
#print(json.dumps(out, indent=4, ensure_ascii=False))
with open("ioBroker_NSPanel_locales.json", "wb") as text_file:
with open("ioBroker_NSPanel_locales_beta.json", "wb") as text_file:
text_file.write(json.dumps(out, indent=4, ensure_ascii=False).encode('utf8'))

View File

@@ -1,5 +1,6 @@
import colorsys
import math
import apis
def scale(val, src, dst):
"""
@@ -37,6 +38,8 @@ def rgb_brightness(rgb_color, brightness):
return [int(red), int(green), int(blue)]
def rgb_dec565(rgb_color):
if type(rgb_color) is str:
rgb_color = apis.ha_api.render_template(rgb_color)
red = rgb_color[0]
green = rgb_color[1]
blue = rgb_color[2]

View File

@@ -25,7 +25,7 @@ class LuiPagesGen(object):
def get_entity_color(self, entity, ha_type=None, overwrite=None):
if overwrite is not None:
if type(overwrite) is list:
if type(overwrite) in [str, list]:
return rgb_dec565(overwrite)
if type(overwrite) is dict:
state = entity.state
@@ -455,16 +455,16 @@ class LuiPagesGen(object):
icon_res = "".join(icon_res_list)
if len(icon_res_list) == 1:
if len(icon_res_list) == 1 and not self._config.get("model") == "us-p":
icon_res = "~"*4 + icon_res_list[0] + "~"*4*6
elif len(icon_res_list) == 2:
elif len(icon_res_list) == 2 and not self._config.get("model") == "us-p":
icon_res = "~"*4*2 + icon_res_list[0] + "~"*4*2 + icon_res_list[1] + "~"*4*2
elif len(icon_res_list) == 3:
elif len(icon_res_list) == 3 and not self._config.get("model") == "us-p":
icon_res = "~"*4*2 + icon_res_list[0] + "~"*4 + icon_res_list[1] + "~"*4 + icon_res_list[2] + "~"*4
elif len(icon_res_list) == 4:
elif len(icon_res_list) == 4 and not self._config.get("model") == "us-p":
icon_res = "~"*4 + icon_res_list[0] + "~"*4 + icon_res_list[1] + "~"*4 + icon_res_list[2] + "~"*4 + icon_res_list[3]
elif len(icon_res_list) >= 5:
icon_res = "~"*4 + "".join(icon_res_list) + "~"*4*(7-len(icon_res_list))
elif len(icon_res_list) >= 5 or self._config.get("model") == "us-p":
icon_res = "".join(icon_res_list) + "~"*4*(8-len(icon_res_list))
currently_translation = get_translation(self._locale, "frontend.ui.card.climate.currently")
state_translation = get_translation(self._locale, "frontend.ui.panel.config.devices.entities.state")
@@ -486,7 +486,7 @@ class LuiPagesGen(object):
else:
media_icon = self.generate_entities_item(entity, "cardGrid")
ha_entity = apis.ha_api.get_entity(entityId)
heading = title if title != "unknown" else entity.attributes.friendly_name
heading = title if title != "unknown" else ha_entity.attributes.friendly_name
title = get_attr_safe(ha_entity, "media_title", "")
author = get_attr_safe(ha_entity, "media_artist", "")
volume = int(get_attr_safe(ha_entity, "volume_level", 0)*100)

View File

@@ -34,7 +34,7 @@ class NsPanelLovelaceUIManager(hass.Hass):
# eu version
desired_display_firmware_url = f"http://nspanel.pky.eu/lovelace-ui/github/nspanel-{version}.tft"
desired_tasmota_driver_version = 6
desired_tasmota_driver_version = 7
desired_tasmota_driver_url = "https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be"
mode = cfg.get("updateMode")

View File

@@ -20,7 +20,7 @@ List of supported config keys of this card:
key | optional | type | default | description
-- | -- | -- | -- | --
`type` | False | string | `None` | Type of the card
`entities` | False | complex | `None` | contains a list of entities of this card
`entity` | False | string | `None` | contains the entitiy of this card
`title` | True | string | `None` | Title of the Page
`temperatureUnit` | True | string | `celsius` | set this to fahrenheit to change the temperatureUnit on the page
`key` | True | string | `None` | Used by navigate items in combination with the type (cardEntities_key)

View File

@@ -45,6 +45,11 @@ It is also possible to configure different color overwrites per state:
"on": [255,0,0]
"off": [0,0,255]
```
Dynamic color overwrites using homeassistant templates:
```yaml
color: '{{iif(states("binary_sensor.test")=="on", "[0,255,0]", "[255,165,0]")}}'
```
It is also possible to use text instead of icons with `text:X`

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -153,6 +153,7 @@ class Nextion : Driver
if (self.flash_mode==1)
var strv = msg[0..-4].asstring()
if string.find(strv,"comok 2")>=0
tasmota.delay(50)
log("FLH: Send (High Speed) flash start")
self.flash_start_millis = tasmota.millis()
#self.sendnx(string.format("whmi-wris %d,115200,res0",self.flash_size))
@@ -162,6 +163,7 @@ class Nextion : Driver
self.sendnx(string.format("whmi-wris %d,%d,res0",self.flash_size,self.flash_proto_baud))
end
if self.flash_proto_baud != 115200
tasmota.delay(50)
self.ser.deinit()
self.ser = serial(17, 16, self.flash_proto_baud, serial.SERIAL_8N1)
end
@@ -319,7 +321,7 @@ tasmota.add_driver(nextion)
def get_current_version(cmd, idx, payload, payload_json)
import string
var version_of_this_script = 6
var version_of_this_script = 7
var jm = string.format("{\"nlui_driver_version\":\"%s\"}", version_of_this_script)
tasmota.publish_result(jm, "RESULT")
end