Add device info for Aemet (#120243)
* Update sensor.py * Update weather.py * Update sensor.py * ruff * add device info to entity * remove info from sensor * remove info from weather * ruff * amend entity * Update sensor.py * Update weather.py * ruff again * add DOMAIN * type unique_id * Update entity.py * Update entity.py * assert * update tests * change snapshot
This commit is contained in:
parent
fe3027f7de
commit
fdade67211
5 changed files with 25 additions and 4 deletions
|
@ -392,10 +392,12 @@ class AemetSensor(AemetEntity, SensorEntity):
|
|||
config_entry: ConfigEntry,
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
super().__init__(coordinator)
|
||||
assert config_entry.unique_id is not None
|
||||
unique_id = config_entry.unique_id
|
||||
super().__init__(coordinator, name, unique_id)
|
||||
self.entity_description = description
|
||||
self._attr_name = f"{name} {description.name}"
|
||||
self._attr_unique_id = f"{config_entry.unique_id}-{description.key}"
|
||||
self._attr_unique_id = f"{unique_id}-{description.key}"
|
||||
|
||||
@property
|
||||
def native_value(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue