mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Use new enums in modern_forms (#61930)
This commit is contained in:
parent
6102e0aae8
commit
85199b4cde
@ -3,9 +3,8 @@ from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from homeassistant.components.sensor import SensorEntity
|
||||
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import DEVICE_CLASS_TIMESTAMP
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import StateType
|
||||
@ -70,7 +69,7 @@ class ModernFormsLightTimerRemainingTimeSensor(ModernFormsSensor):
|
||||
key="light_timer_remaining_time",
|
||||
name=f"{coordinator.data.info.device_name} Light Sleep Time",
|
||||
)
|
||||
self._attr_device_class = DEVICE_CLASS_TIMESTAMP
|
||||
self._attr_device_class = SensorDeviceClass.TIMESTAMP
|
||||
|
||||
@property
|
||||
def native_value(self) -> StateType | datetime:
|
||||
@ -100,7 +99,7 @@ class ModernFormsFanTimerRemainingTimeSensor(ModernFormsSensor):
|
||||
key="fan_timer_remaining_time",
|
||||
name=f"{coordinator.data.info.device_name} Fan Sleep Time",
|
||||
)
|
||||
self._attr_device_class = DEVICE_CLASS_TIMESTAMP
|
||||
self._attr_device_class = SensorDeviceClass.TIMESTAMP
|
||||
|
||||
@property
|
||||
def native_value(self) -> StateType | datetime:
|
||||
|
Loading…
x
Reference in New Issue
Block a user