created types definition file for binary sensors

This commit is contained in:
Tomaae 2022-02-04 21:39:55 +01:00
parent 0b0e15be25
commit 889d270eb7

View file

@ -0,0 +1,43 @@
"""Definitions for Mikrotik Router sensor entities."""
from dataclasses import dataclass, field
from typing import List
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC
from homeassistant.helpers.entity import EntityCategory
from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,
BinarySensorEntityDescription,
)
from .const import DOMAIN
@dataclass
class MikrotikBinarySensorEntityDescription(BinarySensorEntityDescription):
"""Class describing mikrotik entities."""
ha_group: str = ""
ha_connection: str = ""
ha_connection_value: str = ""
data_path: str = ""
data_attribute: str = ""
data_name: str = ""
data_uid: str = ""
data_reference: str = ""
data_attributes_list: List = field(default_factory=lambda: [])
SENSOR_TYPES = {
"system_temperature": MikrotikBinarySensorEntityDescription(
key="system_temperature",
name="Temperature",
icon="mdi:thermometer",
device_class=BinarySensorDeviceClass.CONNECTIVITY,
entity_category=EntityCategory.DIAGNOSTIC,
ha_group="System",
data_path="health",
data_attribute="temperature",
data_name="",
data_uid="",
data_reference="",
),
}