Skip to content

Commit

Permalink
Update sensor.py
Browse files Browse the repository at this point in the history
Additional fixes for the same issue
  • Loading branch information
DanteFragapane authored Jan 3, 2025
1 parent ee66938 commit 5d5e8c3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 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 UnitOfArea.SQUARE_METERS, PERCENTAGE, UnitOfTime
from homeassistant.const import UnitOfArea, 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 @@ -130,7 +130,7 @@ class RoborockSensorDescription(SensorEntityDescription):
entity_category=EntityCategory.DIAGNOSTIC,
),
f"current_{ATTR_STATUS_CLEAN_AREA}": RoborockSensorDescription(
native_unit_of_measurement=AREA_SQUARE_METERS,
native_unit_of_measurement=UnitOfArea.SQUARE_METERS,
icon="mdi:texture-box",
key="clean_area",
value=lambda value, _: round(value / 1000000, 1),
Expand Down Expand Up @@ -174,7 +174,7 @@ class RoborockSensorDescription(SensorEntityDescription):
entity_category=EntityCategory.DIAGNOSTIC,
),
f"clean_history_{ATTR_CLEAN_SUMMARY_TOTAL_AREA}": RoborockSensorDescription(
native_unit_of_measurement=AREA_SQUARE_METERS,
native_unit_of_measurement=UnitOfArea.SQUARE_METERS,
key="clean_area",
value=lambda value, _: round(value / 1000000, 1),
icon="mdi:texture-box",
Expand Down

0 comments on commit 5d5e8c3

Please sign in to comment.