2022-01-11 00:23:31 +00:00
|
|
|
"""Constants for the Homewizard integration."""
|
|
|
|
from __future__ import annotations
|
|
|
|
|
2023-01-16 08:23:03 +00:00
|
|
|
from dataclasses import dataclass
|
2022-01-11 00:23:31 +00:00
|
|
|
from datetime import timedelta
|
|
|
|
|
|
|
|
# Set up.
|
2022-11-27 19:26:15 +00:00
|
|
|
from homewizard_energy.models import Data, Device, State, System
|
2022-01-11 00:23:31 +00:00
|
|
|
|
2022-01-21 09:44:56 +00:00
|
|
|
from homeassistant.const import Platform
|
2022-01-11 00:23:31 +00:00
|
|
|
|
|
|
|
DOMAIN = "homewizard"
|
2022-11-30 09:28:28 +00:00
|
|
|
PLATFORMS = [Platform.BUTTON, Platform.NUMBER, Platform.SENSOR, Platform.SWITCH]
|
2022-01-11 00:23:31 +00:00
|
|
|
|
|
|
|
# Platform config.
|
2022-02-08 22:51:28 +00:00
|
|
|
CONF_API_ENABLED = "api_enabled"
|
|
|
|
CONF_DATA = "data"
|
|
|
|
CONF_DEVICE = "device"
|
|
|
|
CONF_PATH = "path"
|
2022-01-11 00:23:31 +00:00
|
|
|
CONF_PRODUCT_NAME = "product_name"
|
|
|
|
CONF_PRODUCT_TYPE = "product_type"
|
2022-02-08 22:51:28 +00:00
|
|
|
CONF_SERIAL = "serial"
|
2022-01-11 00:23:31 +00:00
|
|
|
|
|
|
|
UPDATE_INTERVAL = timedelta(seconds=5)
|
|
|
|
|
|
|
|
|
2023-01-16 08:23:03 +00:00
|
|
|
@dataclass
|
|
|
|
class DeviceResponseEntry:
|
2022-01-11 00:23:31 +00:00
|
|
|
"""Dict describing a single response entry."""
|
|
|
|
|
|
|
|
device: Device
|
2022-05-25 07:05:11 +00:00
|
|
|
data: Data
|
2023-01-16 08:23:03 +00:00
|
|
|
state: State | None
|
|
|
|
system: System | None = None
|