Skip to content

Commit

Permalink
Merge pull request PlusPlus-ua#2 from michalbundyra/fix/2025.1-deprec…
Browse files Browse the repository at this point in the history
…ations

fix: Clear deprecated constants on HA 2025.1
  • Loading branch information
leonardoleb authored Jan 28, 2024
2 parents 95673d5 + 4c5b986 commit a7c0849
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
9 changes: 4 additions & 5 deletions custom_components/tuya_ble/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
from homeassistant.const import (
CONCENTRATION_PARTS_PER_MILLION,
PERCENTAGE,
TIME_MINUTES,
TIME_SECONDS,
VOLUME_MILLILITERS,
UnitOfTemperature,
UnitOfTime,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity import EntityCategory
Expand Down Expand Up @@ -197,7 +196,7 @@ class TuyaBLEHoldTimeDescription(NumberEntityDescription):
icon: str = "mdi:timer"
native_max_value: float = 10
native_min_value: float = 0
native_unit_of_measurement: str = TIME_SECONDS
native_unit_of_measurement: str = UnitOfTime.SECONDS
native_step: float = 1
entity_category: EntityCategory = EntityCategory.CONFIG

Expand Down Expand Up @@ -385,7 +384,7 @@ class TuyaBLECategoryNumberMapping:
icon="mdi:timer",
native_max_value=120,
native_min_value=1,
native_unit_of_measurement=TIME_MINUTES,
native_unit_of_measurement=UnitOfTime.MINUTES,
native_step=1,
entity_category=EntityCategory.CONFIG,
),
Expand Down Expand Up @@ -422,7 +421,7 @@ class TuyaBLECategoryNumberMapping:
icon="mdi:timer",
native_max_value=1440,
native_min_value=1,
native_unit_of_measurement=TIME_MINUTES,
native_unit_of_measurement=UnitOfTime.MINUTES,
native_step=1,
),
),
Expand Down
7 changes: 3 additions & 4 deletions custom_components/tuya_ble/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
CONCENTRATION_PARTS_PER_MILLION,
PERCENTAGE,
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
TEMP_CELSIUS,
VOLUME_MILLILITERS,
UnitOfTemperature,
UnitOfTime
UnitOfTime,
UnitOfVolume,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity import EntityCategory
Expand Down Expand Up @@ -282,7 +281,7 @@ class TuyaBLECategorySensorMapping:
description=SensorEntityDescription(
key="water_intake",
device_class=SensorDeviceClass.WATER,
native_unit_of_measurement=VOLUME_MILLILITERS,
native_unit_of_measurement=UnitOfVolume.MILLILITERS,
state_class=SensorStateClass.MEASUREMENT,
),
),
Expand Down

0 comments on commit a7c0849

Please sign in to comment.