mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 23:27:37 +00:00
Use shorthand attributes in PEGELONLINE (#143564)
use shorthand attributes
This commit is contained in:
parent
f1975d9dbf
commit
367022dd8c
@ -13,18 +13,13 @@ class PegelOnlineEntity(CoordinatorEntity[PegelOnlineDataUpdateCoordinator]):
|
|||||||
"""Representation of a PEGELONLINE entity."""
|
"""Representation of a PEGELONLINE entity."""
|
||||||
|
|
||||||
_attr_has_entity_name = True
|
_attr_has_entity_name = True
|
||||||
_attr_available = True
|
|
||||||
|
|
||||||
def __init__(self, coordinator: PegelOnlineDataUpdateCoordinator) -> None:
|
def __init__(self, coordinator: PegelOnlineDataUpdateCoordinator) -> None:
|
||||||
"""Initialize a PEGELONLINE entity."""
|
"""Initialize a PEGELONLINE entity."""
|
||||||
super().__init__(coordinator)
|
super().__init__(coordinator)
|
||||||
self.station = coordinator.station
|
self.station = coordinator.station
|
||||||
self._attr_extra_state_attributes = {}
|
self._attr_extra_state_attributes = {}
|
||||||
|
self._attr_device_info = DeviceInfo(
|
||||||
@property
|
|
||||||
def device_info(self) -> DeviceInfo:
|
|
||||||
"""Return the device information of the entity."""
|
|
||||||
return DeviceInfo(
|
|
||||||
identifiers={(DOMAIN, self.station.uuid)},
|
identifiers={(DOMAIN, self.station.uuid)},
|
||||||
name=f"{self.station.name} {self.station.water_name}",
|
name=f"{self.station.name} {self.station.water_name}",
|
||||||
manufacturer=self.station.agency,
|
manufacturer=self.station.agency,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user