Files
NSPanel_HA_Blueprint/nspanel_us_code/media_player.txt
Edward Firmo 591c7aa69b Media player - Buttons
- Added code to buttons on media_player page.
- Clean-up:
  - Moved wake-up select from Blueprint to ESPHome component
  - Removed `switch.xxxxx_confirmation_message`
2023-09-10 22:37:36 +02:00

373 lines
10 KiB
Plaintext

Page media_player
Attributes
ID : 0
Scope : local
Dragging : 0
Send Component ID : disabled
Locked : no
Swide up page ID : disabled
Swide down page ID : disabled
Swide left page ID : disabled
Swide right page ID: disabled
Events
Preinitialize Event
dim=brightness
if(api==0)
{
page home
}else
{
lastclick.txt="{\"page\": \"media_player\", \"component\": \"currentpage\", \"value\": \"pagechange\", \"entity\": \""+entity.txt+"\"}"
printh 92
prints "nspanelevent",0
printh 00
prints lastclick.txt,0
printh 00
printh FF FF FF
}
Touch Press Event
lastclick.txt="{\"page\": \"media_player\", \"component\": \"touchevent\", \"value\": \"press\", \"entity\": \""+entity.txt+"\"}"
printh 92
prints "touchevent",0
printh 00
prints lastclick.txt,0
printh 00
printh FF FF FF
Touch Release Event
lastclick.txt="{\"page\": \"media_player\", \"component\": \"touchevent\", \"value\": \"release\", \"entity\": \""+entity.txt+"\"}"
printh 92
prints "touchevent",0
printh 00
prints lastclick.txt,0
printh 00
printh FF FF FF
Variable (string) back_page
Attributes
ID : 3
Scope : local
Text : home
Max. Text Size: 15
Variable (string) entity
Attributes
ID : 4
Scope : global
Text :
Max. Text Size: 100
Variable (string) lastclick
Attributes
ID : 21
Scope : local
Text :
Max. Text Size: 255
Variable (int32) va_current
Attributes
ID : 23
Scope: local
Value: 0
Variable (int32) va_total
Attributes
ID : 24
Scope: local
Value: 0
Text page_label
Attributes
ID : 1
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : Media Player
Max. Text Size : 25
Text icon_state
Attributes
ID : 2
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 
Max. Text Size : 10
Text vol_text
Attributes
ID : 7
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text bt_vol_down
Attributes
ID : 8
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 3
Events
Touch Release Event
lastclick.txt="{\"page\": \"media_player\", \"event\": \"short_click\", \"component\": \"bt_vol_down\", \"entity\": \""+entity.txt+"\"}"
printh 92
prints "localevent",0
printh 00
prints lastclick.txt,0
printh 00
printh FF FF FF
Text bt_vol_up
Attributes
ID : 9
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 3
Events
Touch Release Event
lastclick.txt="{\"page\": \"media_player\", \"event\": \"short_click\", \"component\": \"bt_vol_up\", \"entity\": \""+entity.txt+"\"}"
printh 92
prints "localevent",0
printh 00
prints lastclick.txt,0
printh 00
printh FF FF FF
Text bt_mute
Attributes
ID : 10
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 3
Events
Touch Release Event
lastclick.txt="{\"page\": \"media_player\", \"event\": \"short_click\", \"component\": \"bt_mute\", \"entity\": \""+entity.txt+"\"}"
printh 92
prints "localevent",0
printh 00
prints lastclick.txt,0
printh 00
printh FF FF FF
Text time_current
Attributes
ID : 12
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text time_total
Attributes
ID : 13
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text track
Attributes
ID : 14
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 50
Text artist
Attributes
ID : 15
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 50
Text bt_prev
Attributes
ID : 16
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Events
Touch Release Event
lastclick.txt="{\"page\": \"media_player\", \"event\": \"short_click\", \"component\": \"bt_prev\", \"entity\": \""+entity.txt+"\"}"
printh 92
prints "localevent",0
printh 00
prints lastclick.txt,0
printh 00
printh FF FF FF
Text bt_play_pause
Attributes
ID : 17
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Events
Touch Release Event
lastclick.txt="{\"page\": \"media_player\", \"event\": \"short_click\", \"component\": \"bt_play_pause\", \"entity\": \""+entity.txt+"\"}"
printh 92
prints "localevent",0
printh 00
prints lastclick.txt,0
printh 00
printh FF FF FF
Text bt_stop
Attributes
ID : 18
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Events
Touch Release Event
lastclick.txt="{\"page\": \"media_player\", \"event\": \"short_click\", \"component\": \"bt_stop\", \"entity\": \""+entity.txt+"\"}"
printh 92
prints "localevent",0
printh 00
prints lastclick.txt,0
printh 00
printh FF FF FF
Text bt_next
Attributes
ID : 19
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Events
Touch Release Event
lastclick.txt="{\"page\": \"media_player\", \"event\": \"short_click\", \"component\": \"bt_next\", \"entity\": \""+entity.txt+"\"}"
printh 92
prints "localevent",0
printh 00
prints lastclick.txt,0
printh 00
printh FF FF FF
Text bt_on_off
Attributes
ID : 20
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Events
Touch Release Event
lastclick.txt="{\"page\": \"media_player\", \"event\": \"short_click\", \"component\": \"bt_on_off\", \"entity\": \""+entity.txt+"\"}"
printh 92
prints "localevent",0
printh 00
prints lastclick.txt,0
printh 00
printh FF FF FF
Progress Bar time_progress
Attributes
ID : 11
Scope : local
Dragging : 0
Send Component ID: disabled
Value : 0
Slider vol_slider
Attributes
ID : 6
Scope : local
Dragging : 0
Send Component ID: disabled
Position : 0
Upper range limit: 100
Lower range limit: 0
Button button_back
Attributes
ID : 5
Scope : local
Dragging : 0
Send Component ID: disabled
State : unpressed
Text : 
Max. Text Size : 3
Events
Touch Press Event
if(back_page.txt=="buttonpage01")
{
page buttonpage01
}else if(back_page.txt=="buttonpage02")
{
page buttonpage02
}else if(back_page.txt=="buttonpage03")
{
page buttonpage03
}else if(back_page.txt=="buttonpage04")
{
page buttonpage04
}else
{
page home
}
Timer tm_progress
Attributes
ID : 22
Scope : local
Period (ms): 1000
Enabled : no
Events
Timer Event
if(va_current.val<va_total.val)
{
va_current.val++
//covx time_progress.val,target_temp.txt,0,0
}