Created
April 18, 2022 15:19
-
-
Save MTrab/abcce994ba0e1e10652455d456bb6363 to your computer and use it in GitHub Desktop.
Pyworxcloud tester
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import pyworxcloud | |
import time | |
from sys import exit | |
from pprint import pprint | |
EMAIL = "MY@EMAIL" | |
PASS = "P455w0rd-H3r3" | |
async def main(): | |
loop = asyncio.get_running_loop() | |
result = await loop.run_in_executor( | |
None, worx_test) | |
def worx_test(): | |
worx = pyworxcloud.WorxCloud() | |
auth = worx.initialize(EMAIL, PASS) | |
if auth: | |
worx.connect(0, False) | |
while True: | |
try: | |
print("Updating Worx") | |
worx.update() | |
worx.getStatus() | |
print(" - Update done") | |
except: | |
print("Ooops - something went wrong!") | |
print("Sleeping 300 seconds") | |
time.sleep(300) | |
asyncio.run(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment