From 080763cee7b68ceb67f263e266e0954f49fa8b64 Mon Sep 17 00:00:00 2001 From: Alexey Melnichuk Date: Tue, 31 Jan 2017 10:35:24 +0300 Subject: [PATCH] Add. Support remote reboot Panasonic devices. (#2326) Tested with Panasonic KX-TGP500 Firmware 22.90 User agent string `Panasonic_KX-TGP500B09/22.90 ()` --- app/devices/resources/classes/device.php | 5 +++-- resources/install/scripts/app/event_notify/index.lua | 11 +++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/devices/resources/classes/device.php b/app/devices/resources/classes/device.php index 4789c726ad..f6a3a0a8eb 100644 --- a/app/devices/resources/classes/device.php +++ b/app/devices/resources/classes/device.php @@ -154,8 +154,9 @@ include "root.php"; if (preg_match('/^es\d\d\d.*$/i', $agent)) { return "escene"; } - } - + if (preg_match('/^.*?panasonic.*$/i', $agent)) { + return "panasonic"; + } // unknown vendor return ""; } diff --git a/resources/install/scripts/app/event_notify/index.lua b/resources/install/scripts/app/event_notify/index.lua index b32ecd5f93..42aa5c11f8 100644 --- a/resources/install/scripts/app/event_notify/index.lua +++ b/resources/install/scripts/app/event_notify/index.lua @@ -124,6 +124,7 @@ event:addHeader('event-string', 'check-sync;reboot=false'); end end + --snom if (vendor == "snom") then if (command == "reboot") then @@ -134,6 +135,16 @@ end end +--panasonic + if (vendor == "panasonic") then + if (command == "reboot") then + event:addHeader('event-string', 'check-sync;reboot=true'); + end + if (command == "check_sync") then + event:addHeader('event-string', 'check-sync;reboot=true'); + end + end + --send the event event:fire();