hass-core/homeassistant/components/wyoming/entity.py
Michael Hansen bcac851677
Migrate Wyoming satellite to Assist satellite entity (#128488)
* Migrate Wyoming satellite to Assist satellite entity

* Fix tests

* Update homeassistant/components/wyoming/assist_satellite.py

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Update homeassistant/components/wyoming/assist_satellite.py

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-10-16 08:59:44 -05:00

25 lines
758 B
Python

"""Wyoming entities."""
from __future__ import annotations
from homeassistant.helpers import entity
from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
from .const import DOMAIN
from .devices import SatelliteDevice
class WyomingSatelliteEntity(entity.Entity):
"""Wyoming satellite entity."""
_attr_has_entity_name = True
_attr_should_poll = False
def __init__(self, device: SatelliteDevice) -> None:
"""Initialize entity."""
self._device = device
self._attr_unique_id = f"{device.satellite_id}-{self.entity_description.key}"
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, device.satellite_id)},
entry_type=DeviceEntryType.SERVICE,
)