Remove the use of StateType from Demo (#97111)
This commit is contained in:
parent
34dcd98440
commit
f8c3aa7bec
1 changed files with 3 additions and 4 deletions
|
@ -25,7 +25,6 @@ from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.event import async_track_time_interval
|
from homeassistant.helpers.event import async_track_time_interval
|
||||||
from homeassistant.helpers.typing import StateType
|
|
||||||
|
|
||||||
from . import DOMAIN
|
from . import DOMAIN
|
||||||
|
|
||||||
|
@ -149,11 +148,11 @@ class DemoSensor(SensorEntity):
|
||||||
self,
|
self,
|
||||||
unique_id: str,
|
unique_id: str,
|
||||||
device_name: str | None,
|
device_name: str | None,
|
||||||
state: StateType,
|
state: float | int | str | None,
|
||||||
device_class: SensorDeviceClass,
|
device_class: SensorDeviceClass,
|
||||||
state_class: SensorStateClass | None,
|
state_class: SensorStateClass | None,
|
||||||
unit_of_measurement: str | None,
|
unit_of_measurement: str | None,
|
||||||
battery: StateType,
|
battery: int | None,
|
||||||
options: list[str] | None = None,
|
options: list[str] | None = None,
|
||||||
translation_key: str | None = None,
|
translation_key: str | None = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
@ -189,7 +188,7 @@ class DemoSumSensor(RestoreSensor):
|
||||||
device_class: SensorDeviceClass,
|
device_class: SensorDeviceClass,
|
||||||
state_class: SensorStateClass | None,
|
state_class: SensorStateClass | None,
|
||||||
unit_of_measurement: str | None,
|
unit_of_measurement: str | None,
|
||||||
battery: StateType,
|
battery: int | None,
|
||||||
suggested_entity_id: str,
|
suggested_entity_id: str,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Initialize the sensor."""
|
"""Initialize the sensor."""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue