1 """Generic entity for the WMS WebControl pro API integration."""
3 from __future__
import annotations
5 from wmspro.destination
import Destination
10 from .const
import ATTRIBUTION, DOMAIN, MANUFACTURER
14 """Foundation of all WMS based entities."""
16 _attr_attribution = ATTRIBUTION
17 _attr_has_entity_name =
True
20 def __init__(self, config_entry_id: str, dest: Destination) ->
None:
21 """Initialize the entity with destination channel."""
22 dest_id_str =
str(dest.id)
26 identifiers={(DOMAIN, dest_id_str)},
27 manufacturer=MANUFACTURER,
28 model=dest.animationType.name,
30 serial_number=dest_id_str,
31 suggested_area=dest.room.name,
32 via_device=(DOMAIN, config_entry_id),
33 configuration_url=f
"http://{dest.host}/control",
37 """Update the entity."""
38 await self.
_dest_dest.refresh()
42 """Return if entity is available."""
43 return self.
_dest_dest.available
None __init__(self, str config_entry_id, Destination dest)