Skip to content

Commit

Permalink
Changes to fix issue humbertogontijo#673, AREA_SQUARE_METERS deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
DanteFragapane authored Jan 3, 2025
1 parent f261913 commit ee66938
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/roborock/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import AREA_SQUARE_METERS, PERCENTAGE, UnitOfTime
from homeassistant.const import UnitOfArea.SQUARE_METERS, PERCENTAGE, UnitOfTime
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity import EntityCategory
from homeassistant.helpers.entity_platform import AddEntitiesCallback
Expand Down Expand Up @@ -100,7 +100,7 @@ class RoborockSensorDescription(SensorEntityDescription):
entity_category=EntityCategory.DIAGNOSTIC,
),
f"last_clean_{ATTR_LAST_CLEAN_AREA}": RoborockSensorDescription(
native_unit_of_measurement=AREA_SQUARE_METERS,
native_unit_of_measurement=UnitOfArea.SQUARE_METERS,
key="area",
value=lambda value, _: round(value / 1000000, 1),
icon="mdi:texture-box",
Expand Down

0 comments on commit ee66938

Please sign in to comment.