Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BROADLINK_ENTITY = {
- vol.Required(CONF_NAME): cv.string,
- vol.Optional(CONF_DOMAIN, default=DEFAULT_DOMAIN): cv.string
- }
- BROADLINK_DEVICE = {
- vol.Required(CONF_HOST): cv.string,
- vol.Required(CONF_MAC): cv.string,
- vol.Required(CONF_TYPE): cv.string
- }
- BROADLINK_COMMANDS = {
- vol.Optional(CONF_COMMAND_ON, default=None): cv.string,
- vol.Optional(CONF_COMMAND_OFF, default=None): cv.string
- }
- BROADLINK_SP_SCHEMA = vol.Schema({
- **BROADLINK_DEVICE,
- **BROADLINK_ENTITY
- })
- BROADLINK_MP_SCHEMA = vol.Schema({
- **BROADLINK_DEVICE,
- vol.Optional(CONF_SLOTS, default=DEFAULT_SLOT_ENTITIES): vol.All(cv.ensure_list,
- [vol.Schema(BROADLINK_ENTITY)])
- })
- BROADLINK_RM_SCHEMA = vol.Schema({
- **BROADLINK_DEVICE,
- vol.Optional(CONF_COMMAND, default=[]): vol.All(cv.ensure_list,
- [vol.Schema({**BROADLINK_ENTITY, **BROADLINK_COMMANDS})])
- })
- CONFIG_SCHEMA = vol.Schema({
- DOMAIN: vol.Schema({
- vol.Optional(CONF_SP, default=[]): vol.All(cv.ensure_list,
- [BROADLINK_SP_SCHEMA]),
- vol.Optional(CONF_MP, default=[]): vol.All(cv.ensure_list,
- [BROADLINK_MP_SCHEMA]),
- vol.Optional(CONF_RM, default=[]): vol.All(cv.ensure_list,
- [BROADLINK_RM_SCHEMA]),
- vol.Optional('discovery', default=True): cv.boolean,
- vol.Optional(CONF_TIMEOUT, default=DEFAULT_TIMEOUT): cv.positive_int
- }),
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement