Some Fixes

This commit is contained in:
JonatanRek 2020-06-29 21:35:17 +02:00
parent 78c29482a6
commit a1358c53fd

View File

@ -106,82 +106,57 @@ class GoogleHomeDeviceTypes {
'media_status'=> [ 'media_status'=> [
'transportControlSupportedCommands' => [ 'transportControlSupportedCommands' => [
"NEXT", "NEXT",
"PREVIOUS", "PREVIOUS",
"PAUSE", "PAUSE",
"STOP", "STOP",
"RESUME", "RESUME",
], ],
], ],
'media_apps' => [ 'media_apps' => [
[ [
"key" => "kodi", "key" => "kodi",
"names" => [ "names" => [
"name_synonym" => [ "name_synonym" => [
"Kodi", "Kodi",
], ],
"lang" => "en" "lang" => "en"
] ]
],
], ],
], 'media_inputs' => [
'media_inputs' => [ [
"key" => "pc", "key" => "pc",
"names" => [ "names" => [
"name_synonym" => [ "name_synonym" => [
"PC", "PC",
], ],
"lang" => "en" "lang" => "en"
] ],
] ],
]; ],
];
static function getAction($deviceType){ static function getAction($deviceType){
if (!isset(self::$actionWordBook[$deviceType])) return; if (!isset(self::$actionWordBook[$deviceType])) return;
return self::$actionWordBook[$deviceType]; return self::$actionWordBook[$deviceType];
} }
static function getTraid($subDeviceType){ static function getTraid($subDeviceType){
if (!isset(self::$traidWordBook[$subDeviceType])) return; if (!isset(self::$traidWordBook[$subDeviceType])) return;
return self::$traidWordBook[$subDeviceType]; return self::$traidWordBook[$subDeviceType];
} }
static function getType($subDeviceCommand){ static function getType($subDeviceCommand){
if (!isset(self::$commandWordBook[$subDeviceCommand])) return; if (!isset(self::$commandWordBook[$subDeviceCommand])) return;
return self::$commandWordBook[$subDeviceCommand]; return self::$commandWordBook[$subDeviceCommand];
} }
static function getAttribute($subDeviceType){ static function getAttribute($subDeviceType){
if (!isset(self::$attributeWordBook[$subDeviceType])) return; if (!isset(self::$attributeWordBook[$subDeviceType])) return;
return self::$attributeWordBook[$subDeviceType]; return self::$attributeWordBook[$subDeviceType];
} }
// static function getSyncObj($deviceBaseObj, $deviceType){
// switch ($deviceType) {
// case 'action.devices.types.LIGHT':
// case 'action.devices.types.OUTLET':
// $deviceBaseObj['traits'] = [
// 'action.devices.traits.OnOff'
// ];
// break;
// case 'action.devices.types.THERMOSTAT':
// $deviceBaseObj['traits'] = [
// 'action.devices.traits.TemperatureSetting',
// ];
// $deviceBaseObj['attributes'] = [
// "availableThermostatModes" => "off,heat",
// "thermostatTemperatureUnit" => "C",
// ];
// break;
// case 'action.devices.types.REMOTECONTROL':
// $deviceBaseObj['traits'] = [
// 'action.devices.traits.Volume',
// 'action.devices.traits.MediaState',
// 'action.devices.traits.OnOff',
// ];
// break;
// }
// return $deviceBaseObj;
// }
static function getQueryJson($deviceType, $type){ static function getQueryJson($deviceType, $type){
return self::$wordBook[$type]; return self::$wordBook[$type];
}
} }
}