Git Product home page Git Product logo

python-draytonwiser-api's People

Contributors

connor9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

python-draytonwiser-api's Issues

Add local API failures count

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 no longer works

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

`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.