From 3294761817a955a61adb7b071977913ebe60d5f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrik=20Spie=C3=9F?= <2924896+mauriceKA@users.noreply.github.com> Date: Sun, 23 Feb 2020 16:00:13 +0100 Subject: [PATCH 1/2] corrected folder name --- ControlDevices/Readme.md | 8 ++++++++ ControlDevices/switch_on_off.py | 23 +++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 ControlDevices/Readme.md create mode 100644 ControlDevices/switch_on_off.py diff --git a/ControlDevices/Readme.md b/ControlDevices/Readme.md new file mode 100644 index 0000000..ad89af0 --- /dev/null +++ b/ControlDevices/Readme.md @@ -0,0 +1,8 @@ +# ControlDevices # +This script will fetch all devices and send on and off commands to the first switch it finds + +## Requirements ## +None + +## Python Requirements ## +None diff --git a/ControlDevices/switch_on_off.py b/ControlDevices/switch_on_off.py new file mode 100644 index 0000000..d09c495 --- /dev/null +++ b/ControlDevices/switch_on_off.py @@ -0,0 +1,23 @@ +import time +import homematicip +from homematicip.home import Home +from homematicip.device import Switch + +config = homematicip.find_and_load_config_file() + +home = Home() +home.set_auth_token(config.auth_token) +home.init(config.access_point) + +def main(): + global home + home.get_current_state() + for device in home.devices: + if isinstance(device, Switch): + device.turn_on() + time.sleep(2) + device.turn_off() + return + +if __name__ == "__main__": + main() From 08bd3b61aee24dda7db152d33b9bc2730c13b0bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrik=20Spie=C3=9F?= <2924896+mauriceKA@users.noreply.github.com> Date: Sun, 23 Feb 2020 16:00:13 +0100 Subject: [PATCH 2/2] corrected folder name --- {ControlDevides => ControlDevices}/Readme.md | 0 {ControlDevides => ControlDevices}/switch_on_off.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {ControlDevides => ControlDevices}/Readme.md (100%) rename {ControlDevides => ControlDevices}/switch_on_off.py (100%) diff --git a/ControlDevides/Readme.md b/ControlDevices/Readme.md similarity index 100% rename from ControlDevides/Readme.md rename to ControlDevices/Readme.md diff --git a/ControlDevides/switch_on_off.py b/ControlDevices/switch_on_off.py similarity index 100% rename from ControlDevides/switch_on_off.py rename to ControlDevices/switch_on_off.py