Skip to content

v2.0.0

Choose a tag to compare

@Nicxe Nicxe released this 15 Jun 09:05
b091de8

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 recommended PLATFORMS constant to register platforms.

  • Improved code consistency and language:
    All inline comments and strings in config_flow.py have 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 uses CoordinatorEntity, which reduces boilerplate and ensures better alignment with Home Assistant patterns.

  • Refined exception handling:
    The _async_update_data method now handles specific exceptions like aiohttp.ClientError and asyncio.TimeoutError instead 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.