Fix Home Assistant 2025 compatibility - #671
Open
2oby wants to merge 1 commit into
Open
Conversation
…ntry_setups, ClimateEntityFeature - Replace removed homeassistant.const string constants with their HA 2025 UnitOf* enum equivalents: TIME_*, TEMP_CELSIUS, POWER_WATT, VOLUME_LITERS, ENERGY_KILO_WATT_HOUR in midea_devices.py and climate.py - Fix async_forward_entry_setup (singular, removed) → async_forward_entry_setups (plural) in __init__.py; also collapse per-platform for-loops into a single batched call as the new API requires - Remove ClimateEntityFeature.AUX_HEAT (removed in HA 2025) from climate.py - Add ClimateEntityFeature.TURN_ON and TURN_OFF (new in HA 2025) so the standard on/off controls work in the UI Tested against Home Assistant 2025.8.3 with a Midea-chipset AC unit.
Contributor
|
This project is abandoned. Check https://github.com/wuwentao/midea_ac_lan |
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
Home Assistant 2025 removed several previously deprecated constants and APIs that this integration depended on. This PR restores compatibility with HA 2025.x (tested on 2025.8.3).
Changes
midea_devices.pyandclimate.py— deprecated unit string constantsThe following constants were removed from
homeassistant.constin HA 2025 and replaced with typed enums:TIME_DAYSUnitOfTime.DAYSTIME_HOURSUnitOfTime.HOURSTIME_MINUTESUnitOfTime.MINUTESTIME_SECONDSUnitOfTime.SECONDSTEMP_CELSIUSUnitOfTemperature.CELSIUSPOWER_WATTUnitOfPower.WATTVOLUME_LITERSUnitOfVolume.LITERSENERGY_KILO_WATT_HOURUnitOfEnergy.KILO_WATT_HOUR__init__.py—async_forward_entry_setupremovedhass.config_entries.async_forward_entry_setup(singular, one platform at a time) was removed. Replaced withasync_forward_entry_setups(plural), which takes a list of platforms in a single call.climate.py—ClimateEntityFeaturechangesClimateEntityFeature.AUX_HEATwas removed in HA 2025 — deleted fromsupported_features.ClimateEntityFeature.TURN_ONandTURN_OFFare new in HA 2025 and required for the standard on/off UI controls to work — added tosupported_features.Testing
Tested on Home Assistant 2025.8.3 with an Olimpia Splendid air conditioner (Midea NetHome WiFi board, protocol V3, port 6444). All climate controls (mode, temperature, fan speed, on/off) working correctly.