v2.0.0rc1
Pre-release
Pre-release
·
171 commits
to refs/heads/main
since this release
What's changed
This is a pre-release version of pyOverkiz 2.0, which has many breaking changes and improved documentation.
Breaking changes
- Minimum Python version is now Python 3.12 (#1871)
client.get_scenarios()replaced byclient.get_action_groups()(#1864)Scenario()model replaced byActionGroup(), wherecreation_timeandmetadataare now optional fields (#1864)client.execute_command()andclient.execute_commands()replaced byclient.execute_action_group()(#1862)OverkizServerclass renamed toServerConfigwith additionalserverandapi_type(cloud/local) property (#1867)generate_local_serverrenamed tocreate_local_server_config(#1867)client.api_typeremoved and now available viaServerConfig(e.g.client.server_config.api_type) (#1867)- The
OverkizClientconstructor now requires passing aServerConfigviaserver(#1867) - The
OverkizClientconstructor now requires passing aCredentialsclass viacredentials, e.g.UsernamePasswordCredentials(USERNAME, PASSWORD)(#1867) - The Device class no longer includes the
idproperty;protocol,gateway_id,device_address, andsubsystem_idmoved todevice.identifier.{}(#1930) Device.data_propertiesremoved (was a non-existent value) (#1930)- Various
UIClassandUIWidgetenums renamed to proper UPPER_SNAKE_CASE (#1925) - All custom exception classes renamed from
*Exceptionto*Error(PEP 8);NotSuchTokenExceptionfixed toNoSuchTokenError(#1987) CommandModerenamed toExecutionMode,cancel_command()tocancel_execution(),execute_scenario()toexecute_persisted_action_group(),execute_scheduled_scenario()toschedule_persisted_action_group()(#1997)Execution.stateis nowExecutionStateinstead ofstr;ActionGroup.idandActionGroup.oidare nowstr | None;get_current_executionreturnsExecution | None(#2007)get_diagnostic_data()return shape changed from flat setup dict to{"setup": ..., "action_groups": ...}(#2016)get_action_groups()returnslist[PersistedActionGroup]instead oflist[ActionGroup];ActionGroupno longer hasoid,creation_time, orlast_update_timefields (#2017)ServerConfig.typerenamed toServerConfig.api_type(#1995)Gateway.connectivitytype changed toConnectivity | None(was non-optional) (#1994)Gateway.idandPlace.idchanged from mutable fields to read-only properties (#1994)States.__getitem__now raisesKeyErrorinstead of returningNone— useStates.get()for old behavior (#1994)CommandDefinitions.__getitem__now raisesKeyErrorinstead of returningNone— useCommandDefinitions.get()for old behavior (#1994)Execution.action_grouptype changed fromlist[Action]toActionGroup | None(#1994)OverkizClient.check_responseremoved and replaced with module-levelpyoverkiz.response_handler.check_response(#1977)pyhumpsdependency removed and replaced with internal_casemodule (#1988)boto3andwarrant-litemoved from required to optional[nexity]extra (#2020)event_listener_idis now a read-only property (#2025)SUPPORTED_SERVERSis now immutable viaMappingProxyType(#2025)obfuscate_sensitive_datareturns a new dict instead of mutating (#2025)get_device_definitionreturnsDefinitionmodel instead of raw dict (#2025)deviceurlparameter renamed todevice_urlfor consistency (#2025)Locationmodel usesNoneinstead of empty string defaults (#2025)- Raises
OverkizErrorinstead ofValueErrorfor API data issues (#2025)
Fixes
client.get_current_executions()now properly typed;Execution()model previously returned list type foraction_groupwhere it should be dict (#1864)Device.data_propertiesremoved (non-existent value) (#1930)Setup.idis nowNonefor Local API, as it doesn't support this (#1974)get_current_executionno longer crashes on empty responses (cloud returns{}, local returns[]ornull) (#2007)- Fixed boolean parsing in Cloud API;
"false"is no longer mapped toTrue(#2015) - Fixed overly broad
INVALID_FIELD_VALUEerror mapping — now requires "Unable to determine action group setup" substring (14f13ae) - Removed redundant
_refresh_token_if_expired()calls infetch_eventsandunregister_event_listenersince_post()already handles this (14f13ae) - Fixed
obfuscate_stringregex to properly handle Unicode characters (e.g. accented letters) (#2037) - Fixed
command_to_enum_name()to treat digits as word boundaries (e.g.discover1WayController→DISCOVER_1_WAY_CONTROLLER) (#2032)
Features
client.execute_action_group()supports multiple execution modes (high priority, internal, geolocated) (#1862)client.execute_action_group()supports multiple device actions in same request (#1862)OverkizClientconstructor supports passing aServerenum directly, e.g.OverkizClient(server=Server.SOMFY_EUROPE, ...)(#1867)OverkizClientnow has an optionalActionQueuefor batching device executions (#1866)- Device class has helper methods for retrieving state value, commands, and definition (#1930)
- Device class has
identifierproperty with protocol, gateway_id, device_address, subsystem_id, base_device_url (#1930) - Device class includes additional fields (data_properties, ui_profiles, ui_classifiers, attributes) under
device.definition(#1930) UIClass,UIWidget, andUIProfileare auto-generated from server definitions (#1925)- Enums with
Unknownvalue inherit fromUnknownEnumMixinto reduce repetition (#1925) - SDK functions to retrieve device info: controllable types, devices, ui_classes, ui_classifiers, ui_profile, ui_widgets (#1925)
- Option to disable PII masking in
get_diagnostic_data(enabled by default) (#1975) boto3is now lazy-imported in Nexity Auth Strategy (#1990)start_time,execution_type,execution_sub_typefields added toExecutionmodel (#2007)NoSuchDeviceErrorandNoSuchActionGroupErrorexception types added (#2007)OverkizClientSettingsfor RTS default duration and future extensibility (#2018)structure_responsehelper consolidates response deserialization (PEP 695 type param syntax) (#2024)- Firmware management methods (
get_firmware_versions,check_firmware_update,start_firmware_update) andUnsupportedOperationErrorexception (ef66c7a) - Additional sensitive states redacted:
internal:CurrentInfraConfigState,core:LocalIPv4AddressState,core:IPAddress,core:MacAddress,core:SerialNumber,core:DeviceSerialNumberState(#2037) lru_cacheadded tocamelize_keyfor performance parity with_decamelize_key(14f13ae)create_local_server_confignow accepts aserverparameter (#2025)
Internal / DX
- Migrated from
pyhumpsto internal_casemodule — 8.4x faster decamelize, 94% smaller (#1988) - Migrated to
cattrsfor centralized model structuring — models are now pure@define(kw_only=True)data classes (#1994) boto3andwarrant-liteare now optional[nexity]dependencies (#2020)- Added
backoffmax_timeandjitterto all retry decorators (#1993) - Replaced magic HTTP status codes with
HTTPStatusconstants (b034971) - Migrated pre-commit to
prek(Rust-based) (#1887) - Developer documentation on GitHub Pages: imicknl.github.io/python-overkiz-api (#1908)
- Migration guide for upgrading from v1 to v2 (ef2277f)
- Enabled ruff rules: PT (#2000), N (#1987), ERA (#1998 batch), FURB/PERF/RSE/RET/PIE (#2001), PYI (#2003), PTH (#2004), A (#2005), PL (#2025), W, LOG, DTZ, FLY, ISC, PGH, SLF, SLOT, TID, INP, ICN, G, BLE, TRY, Q (#1998)
- Version bumped to
2.0.0rc1(#2043)