Conversation
The camelCase -> snake_case rename left compat_aliases.py covering only setters (setMode, setBoostOn, ...) plus getClimate/getLight/etc. Home Assistant core's built-in hive sensor/binary_sensor platforms are written against the old camelCase API and call getter methods directly (e.g. hive.heating.getMode(device)) to populate diagnostic entities such as Mode, State, and Boost sensors, and the hub's Smoke/Dog Bark/Glass Break binary_sensors. Those calls now raise AttributeError since the methods only exist as get_mode()/get_state()/etc, so the entities silently stop updating and go unavailable after the object holding the last cached state is dropped (e.g. on next HA restart). Current/Target Temperature sensors were unaffected because core reads those from the pre-computed device.status dict rather than calling a getter directly. Also fixes an existing gap: WaterHeaterCompatMixin only offered the snake_case get_boost (still used by the Hotwater_Boost sensor), not the camelCase getBoost that HA core calls, so it now provides both. Changes: - HeatingCompatMixin: add getMinTemperature, getMaxTemperature, getCurrentTemperature, getTargetTemperature, getMode, getState, getCurrentOperation, getBoostStatus, getBoostTime, getHeatOnDemand, setHeatOnDemand, getOperationModes, getScheduleNowNextLater, minmaxTemperature - WaterHeaterCompatMixin: add getBoost alongside get_boost (bugfix), getBoostTime, getMode, getState, getOperationModes, getScheduleNowNextLater - LightCompatMixin: add getState, getBrightness, getMinColorTemp, getMaxColorTemp, getColorTemp, getColor, getColorMode - SwitchCompatMixin: add getState, getPowerUsage, getSwitchState - SensorCompatMixin: add getState - ActionCompatMixin: add getState - New HubCompatMixin (getSmokeStatus, getDogBarkStatus, getGlassBreakStatus), wired into HiveHub in devices/hub.py Verified in a Home Assistant instance: all previously-unavailable sensor.*_mode / sensor.*_boost / sensor.*_state entities (10 TRVs + thermostat) and the hub's binary_sensor.hive_hub_status came back after this change, with no regressions to entities that were already working. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The alias commit only tested getBoost, leaving 34 new delegates uncovered and dropping total coverage to 98.95%, below the 99% fail_under gate. Add one parametrized test asserting each alias calls its snake_case method with the same arguments and returns its result. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #158 +/- ##
=======================================
Coverage 99.96% 99.96%
=======================================
Files 30 30
Lines 2571 2643 +72
Branches 297 297
=======================================
+ Hits 2570 2642 +72
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The camelCase → snake_case rename left
helper/compat_aliases.pycovering only the setters (setMode,setBoostOn, …) plusgetClimate/getLight/etc. Most getters were never aliased.Home Assistant core's built-in
hiveintegration (sensor/binary_sensorplatforms) still uses the camelCase API. It calls getters directly for its diagnostic entities, e.g.hive.heating.getMode(device). With this library ondev, those calls raiseAttributeError. As a result, these entities gounavailable:Current/Target Temperature keep working because core reads them from the pre-computed
device.statusdict instead of calling a getter.Changes
All changes are in
src/helper/compat_aliases.pyexcept theHiveHubwiring. Every new method is a one-line delegate to its existing snake_case method.getMinTemperature,getMaxTemperature,getCurrentTemperature,getTargetTemperature,getMode,getState,getCurrentOperation,getBoostStatus,getBoostTime,getHeatOnDemand,setHeatOnDemand,getOperationModes,getScheduleNowNextLater,minmaxTemperaturegetBoost,getBoostTime,getMode,getState,getOperationModes,getScheduleNowNextLatergetState,getBrightness,getMinColorTemp,getMaxColorTemp,getColorTemp,getColor,getColorModegetState,getPowerUsage,getSwitchStategetStateHubCompatMixin:getSmokeStatus,getDogBarkStatus,getGlassBreakStatus, mixed intoHiveHubinsrc/devices/hub.pyNote on
WaterHeaterCompatMixin.get_boostThe existing alias was named
get_boost(snake_case), but HA core callsgetBoost. This PR addsgetBoostand keepsget_boost, becausedevices/sensor.py(Hotwater_Boost) still calls the snake_case name. Renaming it instead would break that sensor.Testing
test_camelcase_get_boost_delegates_to_get_boost_status. The full suite passes (1023 tests).dev.🤖 Generated with Claude Code