v2.0.0
Cleanup and Code Quality Improvements
This update improves the structure, maintainability, and developer friendliness of the smhi_alerts custom integration. While there are no changes to the user-facing behavior, several internal refactors bring the integration in line with Home Assistant's best practices.
✅ Improvements
-
Removed unused dataset:
-
Refactored platform registration:
Instead of importing the sensor platform in__init__.py, the integration now uses the recommendedPLATFORMSconstant to register platforms. -
Improved code consistency and language:
All inline comments and strings inconfig_flow.pyhave been translated from Swedish to English to ensure clarity for contributors. -
Refactored sensor to use CoordinatorEntity:
The sensor no longer manually manages update listeners. It now usesCoordinatorEntity, which reduces boilerplate and ensures better alignment with Home Assistant patterns. -
Refined exception handling:
The_async_update_datamethod now handles specific exceptions likeaiohttp.ClientErrorandasyncio.TimeoutErrorinstead of catching all exceptions generically.
Notes
- This version does not introduce new features or breaking changes.
- No tests have been added yet—future improvements could include basic test coverage and linting.
Thanks to these changes, the integration is now cleaner, more robust, and easier to maintain going forward.