v2.0.0
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_caseinstead ofcamelCaseto be more Pythonic - Added type annotations across the codebase
- error_checking.py:
check_response_for_errorno longerasync
Parameter renames
- alarm.py:
trigger_emergency(): type→emergency_type - Renamed
C4Directorkeyword arguments to justdirectorto avoid shadowing the type annotation - director.py:
send_post_request(): async_variable→is_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
Noneinstead of passing the raw value - climate.py public methods that used to return numbers as strings now return them as
float
Websocket changes
item_callbacksnow 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()andget_video_devices()
Full Changelog: v1.6.0...v2.0.0