2020-09-28 00:02:20 +00:00
|
|
|
"""Constants for 1-Wire component."""
|
2020-10-09 15:31:05 +00:00
|
|
|
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
|
2020-10-27 13:34:25 +00:00
|
|
|
from homeassistant.const import (
|
|
|
|
DEVICE_CLASS_CURRENT,
|
|
|
|
DEVICE_CLASS_HUMIDITY,
|
|
|
|
DEVICE_CLASS_ILLUMINANCE,
|
|
|
|
DEVICE_CLASS_PRESSURE,
|
|
|
|
DEVICE_CLASS_TEMPERATURE,
|
|
|
|
DEVICE_CLASS_VOLTAGE,
|
|
|
|
ELECTRICAL_CURRENT_AMPERE,
|
|
|
|
LIGHT_LUX,
|
|
|
|
PERCENTAGE,
|
|
|
|
PRESSURE_MBAR,
|
|
|
|
TEMP_CELSIUS,
|
|
|
|
VOLT,
|
|
|
|
)
|
2020-10-09 15:31:05 +00:00
|
|
|
|
2020-09-28 00:02:20 +00:00
|
|
|
CONF_MOUNT_DIR = "mount_dir"
|
|
|
|
CONF_NAMES = "names"
|
|
|
|
|
2020-10-09 15:31:05 +00:00
|
|
|
CONF_TYPE_OWFS = "OWFS"
|
|
|
|
CONF_TYPE_OWSERVER = "OWServer"
|
|
|
|
CONF_TYPE_SYSBUS = "SysBus"
|
|
|
|
|
2020-10-24 01:57:16 +00:00
|
|
|
DEFAULT_OWSERVER_HOST = "localhost"
|
2020-09-28 00:02:20 +00:00
|
|
|
DEFAULT_OWSERVER_PORT = 4304
|
|
|
|
DEFAULT_SYSBUS_MOUNT_DIR = "/sys/bus/w1/devices/"
|
|
|
|
|
|
|
|
DOMAIN = "onewire"
|
|
|
|
|
2020-10-15 17:57:15 +00:00
|
|
|
PRESSURE_CBAR = "cbar"
|
|
|
|
|
2020-10-27 13:34:25 +00:00
|
|
|
SENSOR_TYPES = {
|
|
|
|
# SensorType: [ Measured unit, Unit, DeviceClass ]
|
|
|
|
"temperature": ["temperature", TEMP_CELSIUS, DEVICE_CLASS_TEMPERATURE],
|
|
|
|
"humidity": ["humidity", PERCENTAGE, DEVICE_CLASS_HUMIDITY],
|
|
|
|
"humidity_hih3600": ["humidity", PERCENTAGE, DEVICE_CLASS_HUMIDITY],
|
|
|
|
"humidity_hih4000": ["humidity", PERCENTAGE, DEVICE_CLASS_HUMIDITY],
|
|
|
|
"humidity_hih5030": ["humidity", PERCENTAGE, DEVICE_CLASS_HUMIDITY],
|
|
|
|
"humidity_htm1735": ["humidity", PERCENTAGE, DEVICE_CLASS_HUMIDITY],
|
|
|
|
"humidity_raw": ["humidity", PERCENTAGE, DEVICE_CLASS_HUMIDITY],
|
|
|
|
"pressure": ["pressure", PRESSURE_MBAR, DEVICE_CLASS_PRESSURE],
|
|
|
|
"illuminance": ["illuminance", LIGHT_LUX, DEVICE_CLASS_ILLUMINANCE],
|
|
|
|
"wetness_0": ["wetness", PERCENTAGE, DEVICE_CLASS_HUMIDITY],
|
|
|
|
"wetness_1": ["wetness", PERCENTAGE, DEVICE_CLASS_HUMIDITY],
|
|
|
|
"wetness_2": ["wetness", PERCENTAGE, DEVICE_CLASS_HUMIDITY],
|
|
|
|
"wetness_3": ["wetness", PERCENTAGE, DEVICE_CLASS_HUMIDITY],
|
|
|
|
"moisture_0": ["moisture", PRESSURE_CBAR, DEVICE_CLASS_PRESSURE],
|
|
|
|
"moisture_1": ["moisture", PRESSURE_CBAR, DEVICE_CLASS_PRESSURE],
|
|
|
|
"moisture_2": ["moisture", PRESSURE_CBAR, DEVICE_CLASS_PRESSURE],
|
|
|
|
"moisture_3": ["moisture", PRESSURE_CBAR, DEVICE_CLASS_PRESSURE],
|
|
|
|
"counter_a": ["counter", "count", None],
|
|
|
|
"counter_b": ["counter", "count", None],
|
|
|
|
"HobbyBoard": ["none", "none", None],
|
|
|
|
"voltage": ["voltage", VOLT, DEVICE_CLASS_VOLTAGE],
|
|
|
|
"voltage_VAD": ["voltage", VOLT, DEVICE_CLASS_VOLTAGE],
|
|
|
|
"voltage_VDD": ["voltage", VOLT, DEVICE_CLASS_VOLTAGE],
|
|
|
|
"current": ["current", ELECTRICAL_CURRENT_AMPERE, DEVICE_CLASS_CURRENT],
|
|
|
|
}
|
|
|
|
|
2020-09-28 00:02:20 +00:00
|
|
|
SUPPORTED_PLATFORMS = [
|
2020-10-09 15:31:05 +00:00
|
|
|
SENSOR_DOMAIN,
|
2020-09-28 00:02:20 +00:00
|
|
|
]
|