33
44from dataclasses import dataclass
55
6- from custom_components .stromer .coordinator import StromerDataUpdateCoordinator
7-
86from homeassistant .components .binary_sensor import (
97 BinarySensorEntity ,
108 BinarySensorEntityDescription ,
119)
10+ from homeassistant .config_entries import ConfigEntry
11+ from homeassistant .core import HomeAssistant
1212from homeassistant .helpers .entity import EntityCategory
13+ from homeassistant .helpers .entity_platform import AddEntitiesCallback
1314
1415from .const import DOMAIN , LOGGER
16+ from .coordinator import StromerDataUpdateCoordinator
1517from .entity import StromerEntity
1618
1719
1820@dataclass
19- class StromerBinarySensorEntityDescription (BinarySensorEntityDescription ):
21+ class StromerBinarySensorEntityDescription (BinarySensorEntityDescription ): # type: ignore[misc]
2022 """Describes a Stromer binary sensor entity."""
2123
2224 icon_off : str | None = None
@@ -47,7 +49,7 @@ class StromerBinarySensorEntityDescription(BinarySensorEntityDescription):
4749)
4850
4951
50- async def async_setup_entry (hass , config_entry , async_add_entities ) :
52+ async def async_setup_entry (hass : HomeAssistant , config_entry : ConfigEntry , async_add_entities : AddEntitiesCallback ) -> None :
5153 """Set up the Stromer sensors from a config entry."""
5254 coordinator = hass .data [DOMAIN ][config_entry .entry_id ]
5355
@@ -65,7 +67,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
6567 async_add_entities (entities , update_before_add = False )
6668
6769
68- class StromerBinarySensor (StromerEntity , BinarySensorEntity ):
70+ class StromerBinarySensor (StromerEntity , BinarySensorEntity ): # type: ignore[misc]
6971 """Representation of a Binary Sensor."""
7072
7173 _attr_has_entity_name = True
@@ -92,4 +94,4 @@ def __init__(
9294 @property
9395 def is_on (self ) -> bool | None :
9496 """Return true if the binary sensor is on."""
95- return self ._coordinator .data .bikedata .get (self ._ent )
97+ return self ._coordinator .data .bikedata .get (self ._ent ) # type: ignore[no-any-return]
0 commit comments