-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathentity.py
29 lines (22 loc) · 908 Bytes
/
entity.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""Entities"""
from homeassistant.components.switch import SwitchDeviceClass
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from . import PersonioUpdateCoordinator
from .const import DOMAIN
class PersonioAttendanceEntity(CoordinatorEntity[PersonioUpdateCoordinator]):
"""Representation of a attendance entity."""
def __init__(
self,
coordinator: PersonioUpdateCoordinator,
entity_suffix: str,
) -> None:
"""Init from config, hookup enitity and coordinator."""
super().__init__(coordinator)
self._attr_name = "Personio Attendance"
self._attr_unique_id = f"{DOMAIN}_attendance_{entity_suffix}"
self._attr_device_class = SwitchDeviceClass.SWITCH
self._attr_icon = "mdi:briefcase"
@property
def available(self) -> bool:
"""Return if the entity is available."""
return True