Summary
This release streamlines the transition to the v2 API and improves the overall usability of the library. Key updates include:
- Preparations for easier implementation of the v2-only functionality.
- Previous releases required separate handling for v1 and v2 APIs (e.g., v1.data.total_energy_kwh vs v2.measurement.energy_kwh). This release fully aligns with the v2 API, with all models moved to the v2 schema. When v1 is used, data points are automatically remapped to the v2 format for consistency.
Example
python
import HomeWizardEnergy
api: HomeWizardEnergy
if HomeWizardEnergy.has_v2_api("ip_address"):
api = HomeWizardEnergyV2("ip_address", token="<auth_token>")
else:
api = HomeWizardEnergyV1("ip_address")
combined = await api.combined()
print(combined) Same for both versions, content depends on feature set of the device
What's Changed
* Add helper to test if device has v2 API by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/435
* Add helper to get hostname validation string from model and serial id by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/436
* Use pylint ^3.3.3 by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/439
* Move pylint requirement to dev-dependencies by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/440
* Add preliminary support for HWE-BAT by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/438
* Move Device model to root and re-arrange Product by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/441
* Merge v1 and v2 models, use mashumaro for JSON parsing by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/447
* Move LOGGER to const.py by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/448
* Remove Product model and simplify model name conversion by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/449
* Streamline request method in v1 to match v2 by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/450
* Use StateUpdate and SystemUpdate models to set state and system in v1 by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/451
* Add HomeWizardEnergy base class which is implemented in v1 and v2 by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/452
* Reduce backoff retries to 3 by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/454
* Add CombinedModels model and 'fetch-all' method by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/453
* Remove API version check, as v1 API will never update by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/455
* Check before executing unsupported action by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/456
* Add HomeWizardEnergy to root __init__ by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/457
* Rename support_identify to supports_identify, (notice the 's') by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/458
* Measurement in CombinedModels is not Optional, as all devices have support for Measurement API by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/459
* Use native arguments for set-functions and route led_brightness to state for v1 API by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/460
* Remove unused release-drafter by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/461
* Move responsibility of fixing legacy model values to Model itself by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/462
* Bring back full test coverage in `models.py` by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/463
* Move Exceptions fixtures to correct folder by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/464
* Remove handing of non-200 in v1 state/system calls, already handled by _request by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/465
* Cache 'device' model in device() method by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/466
* Use 'native' caching of device in combined method by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/467
* Add tests for cached state identify unsupported check by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/468
* Test for clienterror exception in v2 by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/470
* Remove check of HTTP_NO_CONTENT as there are no 'No Content' replies in v1 by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/469
* Loosen orjson dependency requirement by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/471
* Adjust has_v2_api so test does not trigger 'Was never awaited' error by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/472
* Fix ExternalDeviceType not deserialised correctly by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/473
* Do not remap same keys in v1 to v2 remap by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/474
* Use custom ssl config for injected clientsession by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/475
* Reapply hotfix 'invalid tariff' by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/476
* Update README by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/477
* Print native string value instead Enum when using ExternalDevice.DeviceType value by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/478
* Fix: use total_power_export_t1_kwh instead import as replacement for total_power_export_kwh by DCSBL in https://github.com/homewizard/python-homewizard-energy/pull/479
Dependencies
* Bump aiohttp from 3.11.2 to 3.11.8 by dependabot in https://github.com/homewizard/python-homewizard-energy/pull/431
* Bump ruff from 0.7.1 to 0.8.1 by dependabot in https://github.com/homewizard/python-homewizard-energy/pull/433
* Bump pre-commit-hooks from 4.6.0 to 5.0.0 by dependabot in https://github.com/homewizard/python-homewizard-energy/pull/418
* Bump codecov/codecov-action from 4.6.0 to 5.0.7 by dependabot in https://github.com/homewizard/python-homewizard-energy/pull/434
* Bump pre-commit from 3.8.0 to 4.0.1 by dependabot in https://github.com/homewizard/python-homewizard-energy/pull/432
* Bump pytest-cov from 5.0.0 to 6.0.0 by dependabot in https://github.com/homewizard/python-homewizard-energy/pull/420
* Bump codecov/codecov-action from 5.0.7 to 5.1.2 by dependabot in https://github.com/homewizard/python-homewizard-energy/pull/442
* Bump ruff from 0.8.1 to 0.8.4 by dependabot in https://github.com/homewizard/python-homewizard-energy/pull/443
* Bump pytest-asyncio from 0.24.0 to 0.25.0 by dependabot in https://github.com/homewizard/python-homewizard-energy/pull/444
* Bump poetry from 1.8.4 to 1.8.5 in /.github/workflows by dependabot in https://github.com/homewizard/python-homewizard-energy/pull/446
* Bump async-timeout from 4.0.3 to 5.0.1 by dependabot in https://github.com/homewizard/python-homewizard-energy/pull/445
**Full Changelog**: https://github.com/homewizard/python-homewizard-energy/compare/v7.0.1...v8.0.0