Skip to content
Permalink
Browse files

Merge pull request #319 from AKEB/alpha

Синхронизация простого устройства sensor_light с HomeBridge
  • Loading branch information
sergejey committed Oct 1, 2018
2 parents 79b60e9 + 0711704 commit 6a851e683f3e79ae69cf56010996030910729f16
Showing with 20 additions and 0 deletions.
  1. +20 −0 modules/devices/homebridgeSync.inc.php
@@ -110,6 +110,26 @@
$payload['service']='Switch';
sg('HomeBridge.to_add',json_encode($payload));
} elseif ($devices[$i]['TYPE']=='sensor_light') {
$payload=array();
$payload['name']=$devices[$i]['LINKED_OBJECT'];
sg('HomeBridge.to_remove',json_encode($payload));
$payload=array();
$payload['name']=$devices[$i]['LINKED_OBJECT'];
$payload['service_name']=$devices[$i]['TITLE'];
$payload['service']='LightSensor';
sg('HomeBridge.to_add',json_encode($payload));
$payload=array();
$payload['name']=$devices[$i]['LINKED_OBJECT'];
$payload['service_name']=$devices[$i]['TITLE'];
$payload['service']='LightSensor';
$payload['characteristic'] = 'CurrentAmbientLightLevel';
$payload['value']=gg($devices[$i]['LINKED_OBJECT'].'.value');
sg('HomeBridge.to_set',json_encode($payload));
}
}

0 comments on commit 6a851e6

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