hass-core/homeassistant/components/onewire/const.py
Tim Rightnour 489d85d862
Add Onewire diagnostic and config switches and binary_sensors (#59309)
* Onewire: Add diagnostic and config switches and binary_sensors
This commit adds diagnostic and config switches and binary_sensors to
the HobbyBoards devices.  With these, the user will be able to configure
those devices, without having to run owwrite/owread commands outside
of HA.

* Address review from @epenet

* Add HB_HUB to DEVICE_SUPPORT_OWSERVER

* Device class and entity category enums

* Fixup merge breakage

* Remove duplicate lines
2021-12-07 13:59:43 +01:00

53 lines
1.1 KiB
Python

"""Constants for 1-Wire component."""
from __future__ import annotations
from homeassistant.const import Platform
CONF_MOUNT_DIR = "mount_dir"
CONF_NAMES = "names"
CONF_TYPE_OWSERVER = "OWServer"
CONF_TYPE_SYSBUS = "SysBus"
DEFAULT_OWSERVER_HOST = "localhost"
DEFAULT_OWSERVER_PORT = 4304
DEFAULT_SYSBUS_MOUNT_DIR = "/sys/bus/w1/devices/"
DOMAIN = "onewire"
DEVICE_KEYS_0_3 = range(4)
DEVICE_KEYS_0_7 = range(8)
DEVICE_KEYS_A_B = ("A", "B")
DEVICE_SUPPORT_OWSERVER = {
"05": (),
"10": (),
"12": (),
"1D": (),
"1F": (),
"22": (),
"26": (),
"28": (),
"29": (),
"3A": (),
"3B": (),
"42": (),
"7E": ("EDS0066", "EDS0068"),
"EF": ("HB_HUB", "HB_MOISTURE_METER", "HobbyBoards_EF"),
}
DEVICE_SUPPORT_SYSBUS = ["10", "22", "28", "3B", "42"]
MANUFACTURER_MAXIM = "Maxim Integrated"
MANUFACTURER_HOBBYBOARDS = "Hobby Boards"
MANUFACTURER_EDS = "Embedded Data Systems"
READ_MODE_BOOL = "bool"
READ_MODE_FLOAT = "float"
READ_MODE_INT = "int"
PLATFORMS = [
Platform.BINARY_SENSOR,
Platform.SENSOR,
Platform.SWITCH,
]