connor9 / python-draytonwiser-api Goto Github PK
View Code? Open in Web Editor NEWPython API for Drayton Wiser Home Thermostat system
License: MIT License
Python API for Drayton Wiser Home Thermostat system
License: MIT License
I've noticed that my Wiser Hub will occasionally just not respond to regular HTTP queries. It'll hang in an unresponsive state. If the Manager class is being used in a long running session manner it should try to keep track of local API failures. This can be a similar report to the CloudConnectionStatus key from the API
Sample in the code no longer works, also affects the wiserHA components
`import draytonwiser
manager = draytonwiser.Manager(wiser_hub_ip=HUB_IP_ADDRESS, api_secret=API_SECRET)
devices = manager.get_all_devices()
for device in devices:
print("Type: " + str(type(device)))
print("Room ID: " + str(device.get_room_id()))
print(device.product_type + " ID:[" + str(device.id) + "]")
print("Battery: " + str(device.get_battery_percentage()))
# A measurement object is a related RoomStat or SmartValve. To make it
# easier to iterate the Device class abstracts some of this away for you
# so you don't have to always care if it's a RoomStat or an iTRV or a SmartPlug
if device.has_measurement():
print(" Temperature: " + str(device.measurement.temperature()))
if device.product_type == "RoomStat":
print(" Humidity: " + str(device.measurement.measured_humidity))`
results in
`
Traceback (most recent call last):
File "t.py", line 6, in
devices = manager.get_all_devices()
File "/home/asantaga/.local/lib/python3.6/site-packages/draytonwiser/manager.py", line 153, in get_all_devices
device = self.get_device(jsoned['id'])
File "/home/asantaga/.local/lib/python3.6/site-packages/draytonwiser/manager.py", line 166, in get_device
device = Device.create(**device_data)
File "/home/asantaga/.local/lib/python3.6/site-packages/draytonwiser/device.py", line 60, in create
raise Exception("Invalid Device")
Exception: Invalid Device
`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.