Skip to content
Permalink
Browse files

Update connect.class.php

* CONNECT: system devices not syncing to the cloud now
  • Loading branch information...
sergejey committed Sep 25, 2019
1 parent 58e919a commit 2f50730894e88b1a4e78e1e25caa01d5031354cc
Showing with 3 additions and 2 deletions.
  1. +3 −2 modules/connect/connect.class.php
@@ -535,11 +535,12 @@ function sendDeviceProperty($property, $value)
$url = 'https://connect.smartliving.ru/sync_device_data.php';
$fields = array();
list($object_name, $property_name) = explode('.', $property);
$device_rec = SQLSelectOne("SELECT ID, TITLE, TYPE, SUBTYPE FROM devices WHERE LINKED_OBJECT='" . DBSafe($object_name) . "' AND SYSTEM_DEVICE=0");
if (!$device_rec['ID']) return;
$device_rec = SQLSelectOne("SELECT ID, TITLE, TYPE, SUBTYPE, SYSTEM_DEVICE FROM devices WHERE LINKED_OBJECT='" . DBSafe($object_name) . "' AND SYSTEM_DEVICE=0");
if (!$device_rec['ID'] || $device_rec['SYSTEM_DEVICE']) return;
$fields['object'] = $object_name;
$fields['property'] = $property_name;
$fields['value'] = $value;
unset($device_rec['SYSTEM_DEVICE']);
if ($device_rec['TITLE']) {
$fields['device_data'] = json_encode($device_rec);
}

0 comments on commit 2f50730

Please sign in to comment.
You can’t perform that action at this time.