Skip to content

Instantly share code, notes, and snippets.

@MTrab
Created April 18, 2022 15:19
Show Gist options
  • Save MTrab/abcce994ba0e1e10652455d456bb6363 to your computer and use it in GitHub Desktop.
Save MTrab/abcce994ba0e1e10652455d456bb6363 to your computer and use it in GitHub Desktop.
Pyworxcloud tester
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