Fix
This commit is contained in:
parent
13678630f2
commit
8d2af9181a
@ -38,9 +38,11 @@ class GoogleHomeApi {
|
||||
foreach ($subDevicesData as $subDeviceKey => $subDeviceData) {
|
||||
if ($subDeviceData['type'] != "on/off" && $subDeviceData['type'] != "temp_cont") continue;
|
||||
|
||||
//Google Compatibile Action Type
|
||||
$actionType = GoogleHomeDeviceTypes::getAction($subDeviceData['type']);
|
||||
$tempDevice = [
|
||||
'id' => (string) $subDeviceData['subdevice_id'],
|
||||
'type' => GoogleHomeDeviceTypes::getAction($subDeviceData['type']),
|
||||
'type' => $actionType,
|
||||
'name' => [
|
||||
'name' => $deviceData['name'],
|
||||
],
|
||||
@ -49,13 +51,11 @@ class GoogleHomeApi {
|
||||
];
|
||||
|
||||
//traids & Attributes
|
||||
$tempDevice = GoogleHomeDeviceTypes::getSyncObj($tempDevice, GoogleHomeDeviceTypes::getAction($subDeviceData['type']));
|
||||
$devices[] = $tempDevice;
|
||||
$devices[] = GoogleHomeDeviceTypes::getSyncObj($tempDevice, $actionType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$response = [
|
||||
'requestId' => $requestId,
|
||||
'payload' => [
|
||||
|
@ -83,7 +83,9 @@ class GoogleHomeDeviceTypes {
|
||||
static function getSyncObj($deviceBaseObj, $deviceType){
|
||||
switch ($deviceType) {
|
||||
case 'action.devices.types.OUTLET':
|
||||
$deviceBaseObj['traits'] = 'action.devices.traits.OnOff';
|
||||
$deviceBaseObj['traits'] = [
|
||||
'action.devices.traits.OnOff'
|
||||
];
|
||||
break;
|
||||
case 'action.devices.types.THERMOSTAT':
|
||||
$deviceBaseObj['traits'] = [
|
||||
|
Loading…
Reference in New Issue
Block a user