From 39655e41c779ff1c2cc8d0760749518477260b18 Mon Sep 17 00:00:00 2001 From: Michael Maroszek Date: Sat, 15 Aug 2026 20:30:30 +0200 Subject: [PATCH 1/2] support array returns for some IPS_* functions IPS_GetSnapshot & IPS_GetSnapshotChanges are affected --- IPSViewConnect/module.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/IPSViewConnect/module.php b/IPSViewConnect/module.php index 6959958..484a60f 100644 --- a/IPSViewConnect/module.php +++ b/IPSViewConnect/module.php @@ -182,7 +182,10 @@ protected function GetViewIDByName($viewName) { } } if ($viewID === false) { - $snapshot = json_decode(IPS_GetSnapshot(), true); + $snapshot = IPS_GetSnapshot(); + if (!is_array($snapshot)) { + $snapshot = json_decode($snapshot, true); + } if ($snapshot == null) { throw new Exception('Error during json_decode of Snapshot in GetViewIDByName!'); } @@ -242,7 +245,10 @@ protected function GetInstanceIDUserViews() { // ------------------------------------------------------------------------- protected function API_GetSnapshot($params) { - $snapshot = json_decode(IPS_GetSnapshot(), true); + $snapshot = IPS_GetSnapshot(); + if (!is_array($snapshot)) { + $snapshot = json_decode($snapshot, true); + } if ($snapshot == null) { throw new Exception('Error during json_decode of Snapshot!'); } @@ -332,7 +338,9 @@ protected function API_GetSnapshotChanges($params) { if ($changes === false) { throw new Exception('Error receiving SnapshotChanges: '.print_r(error_get_last(), true)); } - $changes = json_decode($changes, true); + if (!is_array($changes)) { + $changes = json_decode($changes, true); + } $result = Array(); foreach ($changes as $change) { @@ -422,7 +430,10 @@ protected function API_AssignViewData($method, $params) { $view=null; // Add special IP-Symcon Instance IDs - $snapshot = json_decode(IPS_GetSnapshot(), true); + $snapshot = IPS_GetSnapshot(); + if (!is_array($snapshot)) { + $snapshot = json_decode($snapshot, true); + } if ($snapshot == null) { throw new Exception('Error during json_decode of Snapshot in AssignViewData!'); } From c142392acf2b1630299b56ec13e530882163d28a Mon Sep 17 00:00:00 2001 From: Michael Maroszek Date: Sat, 15 Aug 2026 20:43:58 +0200 Subject: [PATCH 2/2] also add support for IPS_GetPresentations change --- IPSViewConnect/module.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/IPSViewConnect/module.php b/IPSViewConnect/module.php index 484a60f..6772efc 100644 --- a/IPSViewConnect/module.php +++ b/IPSViewConnect/module.php @@ -638,7 +638,11 @@ protected function ProcessHookAPIMethod($method, $params) { } else if ($method == 'IPS_GetSnapshotChanges') { return $this->API_GetSnapshotChanges($params); } else if ($method == 'IPS_GetPresentations') { - return IPS_GetPresentations(); + $presentations = IPS_GetPresentations(); + if (is_array($presentations)) { + $presentations = json_encode($presentations); + } + return $presentations; } else if ($method == 'IPS_GetLicensee') { return IPS_GetLicensee();