hass-core/homeassistant/components/wyoming/entity.py
Michael Hansen a9381d2590
Add Wyoming satellite (#104759)
* First draft of Wyoming satellite

* Set up homeassistant in tests

* Move satellite

* Add devices with binary sensor and select

* Add more events

* Add satellite enabled switch

* Fix mistake

* Only set up necessary platforms for satellites

* Lots of fixes

* Add tests

* Use config entry id as satellite id

* Initial satellite test

* Add satellite pipeline test

* More tests

* More satellite tests

* Only support single device per config entry

* Address comments

* Make a copy of platforms
2023-12-04 15:13:15 -05:00

24 lines
695 B
Python

"""Wyoming entities."""
from __future__ import annotations
from homeassistant.helpers import entity
from homeassistant.helpers.device_registry import DeviceInfo
from .const import DOMAIN
from .satellite 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)},
)