diff --git a/app/models/GoogleHome.php b/app/models/GoogleHome.php index e9f3fde..264ebc7 100644 --- a/app/models/GoogleHome.php +++ b/app/models/GoogleHome.php @@ -7,7 +7,7 @@ class GoogleHome { $devicesData = DeviceManager::getAllDevicesInRoom($roomData['room_id']); foreach ($devicesData as $deviceKey => $deviceData) { $traids = []; - $attributes = null; + $attributes = []; //Google Compatibile Action Type $actionType = GoogleHomeDeviceTypes::getAction($deviceData['type']); @@ -22,7 +22,7 @@ class GoogleHome { $deviceAttributes = GoogleHomeDeviceTypes::getAttribute($subDeviceData['type']); if ($deviceAttributes != "") { - $attributes = $deviceAttributes; + $attributes += $deviceAttributes; } } diff --git a/app/models/types/GoogleHomeDeviceTypes.php b/app/models/types/GoogleHomeDeviceTypes.php index d1b03a6..d938611 100644 --- a/app/models/types/GoogleHomeDeviceTypes.php +++ b/app/models/types/GoogleHomeDeviceTypes.php @@ -113,50 +113,53 @@ class GoogleHomeDeviceTypes { ], ], 'media_apps' => [ - [ - "key" => "kodi", - "names" => [ - "name_synonym" => [ - "Kodi", - ], - "lang" => "en" - ] - ], - ], - 'media_inputs' => [ + "availableApplications" => [ [ - "key" => "pc", + "key" => "kodi", "names" => [ - "name_synonym" => [ - "PC", + "name_synonym" => [ + "Kodi", ], - "lang" => "en" + "lang" => "en" ], ], ], - ]; + ], + 'media_inputs' => [ + "availableApplications" => [ + "key" => "pc", + "names" => [ + "name_synonym" => [ + "PC", + ], + "lang" => "en", + ], - static function getAction($deviceType){ - if (!isset(self::$actionWordBook[$deviceType])) return; - return self::$actionWordBook[$deviceType]; - } + ], + ], + ]; - static function getTraid($subDeviceType){ - if (!isset(self::$traidWordBook[$subDeviceType])) return; - return self::$traidWordBook[$subDeviceType]; - } - - static function getType($subDeviceCommand){ - if (!isset(self::$commandWordBook[$subDeviceCommand])) return; - return self::$commandWordBook[$subDeviceCommand]; - } - - static function getAttribute($subDeviceType){ - if (!isset(self::$attributeWordBook[$subDeviceType])) return; - return self::$attributeWordBook[$subDeviceType]; - } - - static function getQueryJson($deviceType, $type){ - return self::$wordBook[$type]; - } + static function getAction($deviceType){ + if (!isset(self::$actionWordBook[$deviceType])) return; + return self::$actionWordBook[$deviceType]; } + + static function getTraid($subDeviceType){ + if (!isset(self::$traidWordBook[$subDeviceType])) return; + return self::$traidWordBook[$subDeviceType]; + } + + static function getType($subDeviceCommand){ + if (!isset(self::$commandWordBook[$subDeviceCommand])) return; + return self::$commandWordBook[$subDeviceCommand]; + } + + static function getAttribute($subDeviceType){ + if (!isset(self::$attributeWordBook[$subDeviceType])) return; + return self::$attributeWordBook[$subDeviceType]; + } + + static function getQueryJson($deviceType, $type){ + return self::$wordBook[$type]; + } +}