Skip to content

v2.0.1 - Code Quality Improvements

Choose a tag to compare

@btli btli released this 26 Nov 19:26

What's Changed

Code Quality Improvements

  • Sensor Refactoring: All 7 sensor classes now inherit from ThermacellLivEntity, eliminating ~170 lines of duplicated code
  • Centralized Constants: Added status constants (STATUS_ERROR, STATUS_PROTECTED, etc.) and scan interval constants to const.py
  • Optimistic Update Helper: Added reusable _async_optimistic_update() method in coordinator
  • Improved Documentation: Better explanations for dunder method usage and ConfigFlow metaclass pattern

Changes

  • sensor.py: Reduced from 433 to 267 lines (-39%)
  • Net reduction of 57 lines while adding new functionality
  • All 161 tests pass

Full Changelog: v2.0.0...v2.0.1