From 2fe6dad264f770cb7d7b2240972a8de13667137c Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 4 Jul 2023 21:17:19 +0200 Subject: [PATCH] . --- .idea/workspace.xml | 70 ++++++++++++++++------------------- scripts/homeassistant.php | 2 +- scripts/lib/harmony.php | 6 +-- scripts/lib/homeassistant.php | 25 ++++++++----- 4 files changed, 51 insertions(+), 52 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 7cce9f2..f8034d5 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,19 +5,10 @@ - - - - - - - - + - - - + - { + "keyToString": { + "RunOnceActivity.OpenProjectViewOnStart": "true", + "RunOnceActivity.ShowReadmeOnStart": "true", + "WebServerToolWindowFactoryState": "true", + "WebServerToolWindowPanel.toolwindow.highlight.mappings": "true", + "WebServerToolWindowPanel.toolwindow.highlight.symlinks": "true", + "WebServerToolWindowPanel.toolwindow.show.date": "false", + "WebServerToolWindowPanel.toolwindow.show.permissions": "false", + "WebServerToolWindowPanel.toolwindow.show.size": "false", + "deletionFromPopupRequiresConfirmation": "false", + "git-widget-placeholder": "master", + "ignore.virus.scanning.warn.message": "true", + "last_opened_file_path": "D:/Works/tortuga-home/scripts", + "node.js.detected.package.eslint": "true", + "node.js.detected.package.tslint": "true", + "node.js.selected.package.eslint": "(autodetect)", + "node.js.selected.package.tslint": "(autodetect)", + "nodejs_package_manager_path": "npm", + "project.structure.last.edited": "Project", + "project.structure.proportion": "0.0", + "project.structure.side.proportion": "0.2", + "ruby.rails.projectView.checked": "true", + "settings.editor.selected.configurable": "editor.preferences.fonts.default", + "vue.rearranger.settings.migration": "true" } -}]]> +} @@ -1225,7 +1216,8 @@ - + + 1641726946298 @@ -1570,7 +1562,7 @@ - diff --git a/scripts/homeassistant.php b/scripts/homeassistant.php index 1902707..7ced31d 100644 --- a/scripts/homeassistant.php +++ b/scripts/homeassistant.php @@ -1,7 +1,7 @@ state)) - return false; - return $data->state; + + if (null === $attribute) { + if (!$data) + return false; + if (!isset($data->state)) + return false; + return $data->state; + } + return ($data->attributes->$attribute) ?? false; + } -function haAction($id, $action='turn_on', $domain = null) { + +function haAction($id, $action = 'turn_on', $domain = null) { $opts = [ "http" => [ "method" => "POST", -- 2.39.5