Add select entity to Overkiz integration (#62916)

This commit is contained in:
Mick Vleeshouwer 2022-01-13 14:35:44 -08:00 committed by GitHub
parent c3c14563e5
commit 5e3bfabfcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 173 additions and 0 deletions

View file

@ -1,9 +1,12 @@
"""Parent class for every Overkiz device."""
from __future__ import annotations
from enum import unique
from pyoverkiz.enums import OverkizAttribute, OverkizState
from pyoverkiz.models import Device
from homeassistant.backports.enum import StrEnum
from homeassistant.helpers.entity import DeviceInfo, EntityDescription
from homeassistant.helpers.update_coordinator import CoordinatorEntity
@ -95,3 +98,12 @@ class OverkizDescriptiveEntity(OverkizEntity):
self.entity_description = description
self._attr_name = f"{super().name} {self.entity_description.name}"
self._attr_unique_id = f"{super().unique_id}-{self.entity_description.key}"
# Used by translations of state and select sensors
@unique
class OverkizDeviceClass(StrEnum):
"""Device class for Overkiz specific devices."""
OPEN_CLOSED_PEDESTRIAN = "overkiz__open_closed_pedestrian"
MEMORIZED_SIMPLE_VOLUME = "overkiz__memorized_simple_volume"