Home Assistant Unofficial Reference 2024.12.1
const.py
Go to the documentation of this file.
1 """Constants for the Homewizard integration."""
2 
3 from __future__ import annotations
4 
5 from dataclasses import dataclass
6 from datetime import timedelta
7 import logging
8 
9 from homewizard_energy.v1.models import Data, Device, State, System
10 
11 from homeassistant.const import Platform
12 
13 DOMAIN = "homewizard"
14 PLATFORMS = [Platform.BUTTON, Platform.NUMBER, Platform.SENSOR, Platform.SWITCH]
15 
16 LOGGER = logging.getLogger(__package__)
17 
18 # Platform config.
19 CONF_API_ENABLED = "api_enabled"
20 CONF_DATA = "data"
21 CONF_PRODUCT_NAME = "product_name"
22 CONF_PRODUCT_TYPE = "product_type"
23 CONF_SERIAL = "serial"
24 
25 UPDATE_INTERVAL = timedelta(seconds=5)
26 
27 
28 @dataclass
30  """Dict describing a single response entry."""
31 
32  device: Device
33  data: Data
34  state: State | None = None
35  system: System | None = None