mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-24 00:14:26 +01:00
Merge branch 'joBr99:main' into main
This commit is contained in:
@@ -6312,6 +6312,10 @@ function HandleButtonEvent(words: any): void {
|
||||
alwaysOn = false;
|
||||
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) {
|
||||
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)
|
||||
function GetNavigationString(pageId: number): string {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user