Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes deprecation warnings in HA 2024.2.x #74

Merged
merged 3 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,17 @@ If you are winding up having to do multiple restarts because Home Assistant won'

Alternatively, with the menu restructuring, the menu entry for _Stop Server_ isn't accessible. However you can use the keyboard short cut 'c' and type restart to find that choice. Once the server has stopped you can move the config entry in and do a `ha core start`

#### Debugging flags

If you do encounter issues, here are the logger settings in the Home Assistant configuration file you use to set debug or other levels of logging.

```
logger:
default: warning
logs:
custom_components.warmup.climate: debug
custom_components.warmup.warmup4ie.warmup4ie: debug
```
### Add your devices to the dashboard

Our wiki has some [ideas on how to configure warmup
Expand Down
16 changes: 15 additions & 1 deletion custom_components/warmup/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
CONF_USERNAME,
PRECISION_HALVES,
UnitOfTemperature,
MAJOR_VERSION,
MINOR_VERSION,
)

from homeassistant.exceptions import InvalidStateError, PlatformNotReady
import homeassistant.helpers.config_validation as cv
from homeassistant.util import Throttle
Expand Down Expand Up @@ -67,7 +70,7 @@
CONST_MODE_OFF: HVACMode.OFF,
}

SUPPORT_FLAGS = ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.PRESET_MODE
SUPPORT_FLAGS = ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.PRESET_MODE | ClimateEntityFeature.TURN_ON |ClimateEntityFeature.TURN_OFF
SUPPORT_HVAC_HEAT = [HVACMode.HEAT, HVACMode.AUTO, HVACMode.OFF]
SUPPORT_PRESET = [PRESET_AWAY, PRESET_HOME, PRESET_BOOST]

Expand Down Expand Up @@ -152,6 +155,9 @@ def __init__(self, hass, device: Warmup4IEDevice, client: WarmupClient):
self._away = False
self._on = True

# https://developers.home-assistant.io/blog/2024/01/24/climate-climateentityfeatures-expanded
self._enable_turn_on_off_backwards_compatibility = False

@property
def name(self):
"""Return the name of the climate device."""
Expand Down Expand Up @@ -250,6 +256,14 @@ def set_hvac_mode(self, hvac_mode):
else:
raise InvalidStateError

def turn_on(self) -> None:
"""Turn the entity on."""
self.set_hvac_mode(HVACMode.AUTO)

def turn_off(self) -> None:
"""Turn the entity off."""
self.set_hvac_mode(HVACMode.OFF)

def set_override(self, temperature, until):
"""Set a temperature override for this thermostat."""
self._device.set_override(temperature, until)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/warmup/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/ha-warmup/warmup/issues/",
"requirements": [],
"version": "2024.2.7"
"version": "2024.2.8"
}