mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-24 00:14:26 +01:00
fixed unintended dim on startup, implemented playpause on media page
This commit is contained in:
@@ -105,7 +105,7 @@ entityUpd,*internalNameEntiy*,*heading*,*currentTemp*,*destTemp*,*status*,*minTe
|
||||
|
||||
### cardMedia Page
|
||||
|
||||
entityUpd,|*internalNameEntiy*|*heading*|*icon*|*title*|*author*|*volume*
|
||||
entityUpd,|*internalNameEntiy*|*heading*|*icon*|*title*|*author*|*volume*|*playpauseicon*
|
||||
|
||||
## Messages from Nextion Display
|
||||
|
||||
@@ -177,6 +177,8 @@ ID | Icon
|
||||
5 | 
|
||||
6 | 
|
||||
7 | 
|
||||
8 | 
|
||||
9 | 
|
||||
|
||||
|
||||
# Design Guidelines for Nextion HMI Project
|
||||
|
||||
BIN
HMI/nspanel.HMI
BIN
HMI/nspanel.HMI
Binary file not shown.
BIN
HMI/nspanel.tft
BIN
HMI/nspanel.tft
Binary file not shown.
@@ -304,6 +304,7 @@ class NsPanelLovelanceUI:
|
||||
title = ""
|
||||
author = ""
|
||||
volume = 0
|
||||
iconplaypause = 8
|
||||
if "media_content_type" in entity.attributes:
|
||||
if entity.attributes.media_content_type == "music":
|
||||
icon = 5
|
||||
@@ -313,8 +314,13 @@ class NsPanelLovelanceUI:
|
||||
author = entity.attributes.media_artist
|
||||
if "volume_level" in entity.attributes:
|
||||
volume = int(entity.attributes.volume_level*100)
|
||||
|
||||
if entity.state == "playing":
|
||||
iconplaypause = 8
|
||||
else:
|
||||
iconplaypause = 9
|
||||
|
||||
return "entityUpd,|{0}|{1}|{2}|{3}|{4}|{5}".format(item, heading, icon, title, author, volume)
|
||||
return f"entityUpd,|{item}|{heading}|{icon}|{title}|{author}|{volume}|{iconplaypause}"
|
||||
|
||||
|
||||
def generate_page(self, page_number, page_type):
|
||||
|
||||
Reference in New Issue
Block a user