Skip to content

v2.0.0

Choose a tag to compare

@lawtancool lawtancool released this 20 Feb 19:46
· 7 commits to master since this release

Breaking public API changes

v2.0.0 introduces a number of breaking API changes intended to improve robustness, which will require clients to update their code.

Code quality changes

  • Rename all methods to be snake_case instead of camelCase to be more Pythonic
  • Added type annotations across the codebase
  • error_checking.py: check_response_for_error no longer async

Parameter renames

  • alarm.py: trigger_emergency(): typeemergency_type
  • Renamed C4Director keyword arguments to just director to avoid shadowing the type annotation
  • director.py: send_post_request(): async_variableis_async

Parsing changes

  • director.py public methods that used to return raw JSON strings now return parsed Python lists and dicts
  • alarm.py and climate.py public methods that used to return comma-separated lists as raw strings now return parsed Python lists
  • When Control4 returns "Undefined" as a variable value, the library now returns None instead of passing the raw value
  • climate.py public methods that used to return numbers as strings now return them as float

Websocket changes

  • item_callbacks now returns a read-only view of all callbacks, instead of only the first callback for each device ID.

New Features

  • alarm.py: Added C4SecurityPanel.get_arm_types() method
  • websocket.py: Added passing caller's session to socketio to avoid blocking SSL calls in event loop

Bug fixes

  • websocket.py: fixed session leak when not passing in a session
  • director.py: improved Control4 API response validation
  • room.py: fixed return from get_audio_devices() and get_video_devices()

Full Changelog: v1.6.0...v2.0.0