Skip to content

Commit

Permalink
(Fixed) TEMP_CELSIUS deprecated since 2025.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislav authored and IATkachenko committed Jan 27, 2025
1 parent deb81d9 commit ccf8296
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
.venv
4 changes: 2 additions & 2 deletions custom_components/ha_tion_btle/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.const import TEMP_CELSIUS
from homeassistant.const import UnitOfTemperature
import voluptuous as vol

from homeassistant.components.climate import ClimateEntity, ClimateEntityFeature, HVACMode, HVACAction
Expand Down Expand Up @@ -67,7 +67,7 @@ class TionClimateEntity(ClimateEntity, CoordinatorEntity):
_attr_fan_modes = [1, 2, 3, 4, 5, 6]
_attr_precision = PRECISION_WHOLE
_attr_target_temperature_step = 1
_attr_temperature_unit = TEMP_CELSIUS
_attr_temperature_unit = UnitOfTemperature.CELSIUS
_attr_preset_modes = [PRESET_NONE, PRESET_BOOST, PRESET_SLEEP]
_attr_preset_mode = PRESET_NONE
_attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.FAN_MODE | ClimateEntityFeature.PRESET_MODE
Expand Down
6 changes: 3 additions & 3 deletions custom_components/ha_tion_btle/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from datetime import timedelta

from homeassistant.components.sensor import SensorEntityDescription, SensorDeviceClass, SensorStateClass, SensorEntity
from homeassistant.const import TEMP_CELSIUS
from homeassistant.const import UnitOfTemperature
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import EntityCategory
Expand All @@ -22,7 +22,7 @@
SensorEntityDescription(
key="in_temp",
name="input temperature",
native_unit_of_measurement=TEMP_CELSIUS,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
entity_registry_enabled_default=True,
Expand All @@ -31,7 +31,7 @@
SensorEntityDescription(
key="out_temp",
name="output temperature",
native_unit_of_measurement=TEMP_CELSIUS,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
entity_registry_enabled_default=True,
Expand Down

0 comments on commit ccf8296

Please sign in to comment.