mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-12 08:07:43 +01:00
Merge branch 'joBr99:main' into main
This commit is contained in:
@@ -6312,6 +6312,10 @@ function HandleButtonEvent(words: any): void {
|
|||||||
alwaysOn = false;
|
alwaysOn = false;
|
||||||
SendToPanel({ payload: 'timeout~' + getState(NSPanel_Path + 'Config.Screensaver.timeoutScreensaver').val });
|
SendToPanel({ payload: 'timeout~' + getState(NSPanel_Path + 'Config.Screensaver.timeoutScreensaver').val });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setOrCreate(NSPanel_Path + "Event.Button.Action", buttonAction ?? words[2]);
|
||||||
|
setOrCreate(NSPanel_Path + "Event.Button.Value", words[4] != undefined ? words[4] : null);
|
||||||
|
setOrCreate(NSPanel_Path + "Event.Button.Id", id);
|
||||||
|
|
||||||
if (Debug) {
|
if (Debug) {
|
||||||
log('HandleButtonEvent buttonAction: ' + buttonAction, 'info');
|
log('HandleButtonEvent buttonAction: ' + buttonAction, 'info');
|
||||||
@@ -7359,6 +7363,14 @@ function HandleButtonEvent(words: any): void {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setOrCreate(id : string, value : any, forceCreation: boolean = true, common: Partial<iobJS.StateCommon> = { }, callback?: iobJS.SetStateCallback) {
|
||||||
|
if (!existsState(id)) {
|
||||||
|
createState(id, value, forceCreation, common, callback);
|
||||||
|
} else {
|
||||||
|
setState(id, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Determination of page navigation (CustomSend-Payload)
|
//Determination of page navigation (CustomSend-Payload)
|
||||||
function GetNavigationString(pageId: number): string {
|
function GetNavigationString(pageId: number): string {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user