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