Patch release focused on bug fixes and reliability improvements found during a comprehensive code review. All changes include test coverage.
๐ด Critical Fixes
-
Fix unchecked dict access in heater timer parsing (#550) โ
timeron["du"]crashed withTypeErrorwhen timer data wasNoneor missing thedukey. Now uses safeisinstancecheck and.get(). -
Fix WebSocket deadlock from threading.Lock in async code (#549) โ The WebSocket send lock (
threading.Lock) was used inside async coroutines. When two coroutines contended for the lock, it blocked the entire event loop, causing a deadlock. Replaced withasyncio.Lock. Also added proper WS close + thread join on shutdown, error handling for connection failures, and retry logic for send failures.
๐ High-Priority Fixes
-
Fix inverted range validation for heater htalevel/ecolevel (#546) โ Chained comparison
min > value > maxwas alwaysFalse, so invalid values were silently sent to the device. Fixed tonot (min <= value <= max). -
Fix fan turn_on ignoring percentage and preset_mode (#547) โ HA service calls like
fan.turn_on(percentage=50)would power on but not apply the speed or preset. -
Fix duplicate sensor key collision (#551) โ Two sensors shared the key
"Use since cleaning", causing the humidifier work-time sensor to be silently dropped. Renamed to"Use since cleaning HM". Note: Humidifier work-time sensor entities may need to be re-added after update. -
Fix getattr on dict in get_device_range (#552) โ
getattr()was used ondevice_ranges(adict), so per-model range overrides for Number entities were silently ignored. Changed todict.get(). -
Fix power-on key None guard in fan base (#553) โ If neither
POWERON_KEYnorFANON_KEYwas in the initial state, the power-on key becameNone, causing errors when toggling the fan. -
Add exception handling in _do_callbacks (#554) โ A single bad callback would crash
_do_callbacks()and prevent all remaining callbacks from executing. Now each callback is wrapped intry/except. -
Add access_token and deviceId to diagnostics redaction (#548) โ These sensitive fields were not being redacted in diagnostic dumps.
๐ก Medium Fixes
-
Fix fan speed validation lower bound (#555) โ Speed setter hardcoded
1as minimum instead of using the device's actual_speed_range[0]. -
Fix logger namespace typo in manifest.json (#556) โ
"custom_compoments"โ"custom_components". This typo prevented HA's debug logging UI from capturing integration logs. -
Fix RGB tuple length validation (#557) โ
_clamp_rgb_tuplenow validates that the input has exactly 3 elements. -
Fix
name_from_valuereturn type annotation (#557) โ Changed-> strto-> str | Noneto match actual behavior. -
Fix
device_rangestype annotation (#557) โ Changeddict[range]todict[str, tuple]to reflect actual usage.
๐งช Test Coverage
- 72 new tests added (#545, merged in v1.7.0 cycle) covering
config_flow.py,diagnostics.py,commandtransport.py, and__init__.py - All fixes include corresponding test coverage
- Total test count: 348+ passing tests
Full Changelog: v1.7.0...v1.7.1