mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Fix multi inheritance with CoordinatorEntity (#85053)
This commit is contained in:
parent
6718b40181
commit
516cb31635
@ -90,7 +90,7 @@ class BSBLANClimate(
|
||||
) -> None:
|
||||
"""Initialize BSBLAN climate device."""
|
||||
super().__init__(client, device, info, static, entry)
|
||||
super(CoordinatorEntity, self).__init__(coordinator)
|
||||
CoordinatorEntity.__init__(self, coordinator)
|
||||
self._attr_unique_id = f"{format_mac(device.MAC)}-climate"
|
||||
|
||||
self._attr_min_temp = float(static.min_temp.value)
|
||||
|
@ -76,7 +76,7 @@ class ElgatoLight(
|
||||
) -> None:
|
||||
"""Initialize Elgato Light."""
|
||||
super().__init__(client, info, mac)
|
||||
super(CoordinatorEntity, self).__init__(coordinator)
|
||||
CoordinatorEntity.__init__(self, coordinator)
|
||||
|
||||
self._attr_min_mireds = 143
|
||||
self._attr_max_mireds = 344
|
||||
|
@ -203,7 +203,7 @@ class ScrapeSensor(CoordinatorEntity[ScrapeCoordinator], TemplateSensor):
|
||||
value_template: Template | None,
|
||||
) -> None:
|
||||
"""Initialize a web scrape sensor."""
|
||||
super(CoordinatorEntity, self).__init__(coordinator)
|
||||
CoordinatorEntity.__init__(self, coordinator)
|
||||
TemplateSensor.__init__(
|
||||
self,
|
||||
hass,
|
||||
|
@ -400,6 +400,15 @@ class BaseCoordinatorEntity(entity.Entity, Generic[_BaseDataUpdateCoordinatorT])
|
||||
class CoordinatorEntity(BaseCoordinatorEntity[_DataUpdateCoordinatorT]):
|
||||
"""A class for entities using DataUpdateCoordinator."""
|
||||
|
||||
def __init__(
|
||||
self, coordinator: _DataUpdateCoordinatorT, context: Any = None
|
||||
) -> None:
|
||||
"""Create the entity with a DataUpdateCoordinator. Passthrough to BaseCoordinatorEntity.
|
||||
|
||||
Necessary to bind TypeVar to correct scope.
|
||||
"""
|
||||
super().__init__(coordinator, context)
|
||||
|
||||
@property
|
||||
def available(self) -> bool:
|
||||
"""Return if entity is available."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user