2019-04-18 10:43:34 +00:00
|
|
|
"""Constants for Orange Pi GPIO."""
|
2019-10-21 11:56:03 +00:00
|
|
|
|
2019-04-18 10:43:34 +00:00
|
|
|
import voluptuous as vol
|
|
|
|
|
|
|
|
from homeassistant.helpers import config_validation as cv
|
|
|
|
|
2019-07-31 19:25:30 +00:00
|
|
|
CONF_INVERT_LOGIC = "invert_logic"
|
2019-10-21 11:56:03 +00:00
|
|
|
CONF_PIN_MODE = "pin_mode"
|
2019-07-31 19:25:30 +00:00
|
|
|
CONF_PORTS = "ports"
|
2019-04-18 10:43:34 +00:00
|
|
|
DEFAULT_INVERT_LOGIC = False
|
2019-10-21 11:56:03 +00:00
|
|
|
PIN_MODES = ["pc", "zeroplus", "zeroplus2", "deo", "neocore2"]
|
2019-04-18 10:43:34 +00:00
|
|
|
|
2019-07-31 19:25:30 +00:00
|
|
|
_SENSORS_SCHEMA = vol.Schema({cv.positive_int: cv.string})
|
2019-04-18 10:43:34 +00:00
|
|
|
|
|
|
|
PORT_SCHEMA = {
|
|
|
|
vol.Required(CONF_PORTS): _SENSORS_SCHEMA,
|
2019-04-19 11:26:53 +00:00
|
|
|
vol.Required(CONF_PIN_MODE): vol.In(PIN_MODES),
|
2019-04-18 10:43:34 +00:00
|
|
|
vol.Optional(CONF_INVERT_LOGIC, default=DEFAULT_INVERT_LOGIC): cv.boolean,
|
|
|
|
}
|