Python homeassistant.helpers.config_validation.boolean() Examples
The following are 8
code examples of homeassistant.helpers.config_validation.boolean().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
homeassistant.helpers.config_validation
, or try the search function
.
Example #1
Source File: create_schema.py From visonic with Apache License 2.0 | 5 votes |
def create_parameters1cv(options): # Panel settings - can only be set on creation return { vol.Required(CONF_LANGUAGE, default=create_default(options, CONF_LANGUAGE, "EN") ) : cv.string, vol.Optional(CONF_EXCLUDE_SENSOR, default=create_default(options, CONF_EXCLUDE_SENSOR, "")) : cv.string, vol.Optional(CONF_EXCLUDE_X10, default=create_default(options, CONF_EXCLUDE_X10, "")) : cv.string, vol.Optional(CONF_DOWNLOAD_CODE, default=create_default(options, CONF_DOWNLOAD_CODE, "") ) : cv.string, vol.Optional(CONF_FORCE_STANDARD, default=create_default(options, CONF_FORCE_STANDARD, False)) : cv.boolean, vol.Optional(CONF_FORCE_AUTOENROLL, default=create_default(options, CONF_FORCE_AUTOENROLL, False)) : cv.boolean, vol.Optional(CONF_AUTO_SYNC_TIME, default=create_default(options, CONF_AUTO_SYNC_TIME, True)) : cv.boolean }
Example #2
Source File: create_schema.py From visonic with Apache License 2.0 | 5 votes |
def create_parameters2cv(options): # Panel settings - can be modified/edited return { vol.Optional(CONF_MOTION_OFF_DELAY, default=create_default(options, CONF_MOTION_OFF_DELAY, 120) ) : cv.positive_int, vol.Optional(CONF_SIREN_SOUNDING, default=create_default(options, CONF_SIREN_SOUNDING,["intruder"])) : cv.multi_select(available_siren_values), vol.Optional(CONF_OVERRIDE_CODE, default=create_default(options, CONF_OVERRIDE_CODE, "") ) : cv.string, vol.Optional(CONF_ARM_CODE_AUTO, default=create_default(options, CONF_ARM_CODE_AUTO, False)) : cv.boolean, vol.Optional(CONF_FORCE_KEYPAD, default=create_default(options, CONF_FORCE_KEYPAD, False)) : cv.boolean, vol.Optional(CONF_INSTANT_ARM_AWAY, default=create_default(options, CONF_INSTANT_ARM_AWAY, False)) : cv.boolean, vol.Optional(CONF_INSTANT_ARM_HOME, default=create_default(options, CONF_INSTANT_ARM_HOME, False)) : cv.boolean, vol.Optional(CONF_ENABLE_REMOTE_ARM, default=create_default(options, CONF_ENABLE_REMOTE_ARM, False)) : cv.boolean, vol.Optional(CONF_ENABLE_REMOTE_DISARM, default=create_default(options, CONF_ENABLE_REMOTE_DISARM, False)) : cv.boolean, vol.Optional(CONF_ENABLE_SENSOR_BYPASS, default=create_default(options, CONF_ENABLE_SENSOR_BYPASS, False)) : cv.boolean }
Example #3
Source File: create_schema.py From visonic with Apache License 2.0 | 5 votes |
def create_parameters3cv(options): # Log file parameters return { vol.Optional(CONF_LOG_EVENT, default=create_default(options, CONF_LOG_EVENT, False)) : cv.boolean, vol.Optional(CONF_LOG_DONE, default=create_default(options, CONF_LOG_DONE, False)) : cv.boolean, vol.Optional(CONF_LOG_REVERSE, default=create_default(options, CONF_LOG_REVERSE, False)) : cv.boolean, vol.Optional(CONF_LOG_CSV_TITLE, default=create_default(options, CONF_LOG_CSV_TITLE, False)) : cv.boolean, vol.Optional(CONF_LOG_XML_FN, default=create_default(options, CONF_LOG_XML_FN, "")) : cv.string, vol.Optional(CONF_LOG_CSV_FN, default=create_default(options, CONF_LOG_CSV_FN, "")) : cv.string, vol.Optional(CONF_LOG_MAX_ENTRIES, default=create_default(options, CONF_LOG_MAX_ENTRIES, 10000)) : cv.positive_int }
Example #4
Source File: create_schema.py From visonic with Apache License 2.0 | 5 votes |
def create_parameters4cv(options): # B0 related parameters (PowerMaster only) return { vol.Optional(CONF_B0_ENABLE_MOTION_PROCESSING, default=create_default(options, CONF_B0_ENABLE_MOTION_PROCESSING, False)) : cv.boolean, vol.Optional(CONF_B0_MAX_TIME_FOR_TRIGGER_EVENT, default=create_default(options, CONF_B0_MAX_TIME_FOR_TRIGGER_EVENT, 5)) : cv.positive_int, vol.Optional(CONF_B0_MIN_TIME_BETWEEN_TRIGGERS, default=create_default(options, CONF_B0_MIN_TIME_BETWEEN_TRIGGERS, 30)) : cv.positive_int }
Example #5
Source File: __init__.py From home-assistant-custom-components with MIT License | 5 votes |
def __init__(self, hass, slug_id, name, initial, entity_config): """Initialize a boolean input.""" self.hass = hass self.entity_id = async_generate_entity_id(ENTITY_ID_FORMAT, slug_id, hass=hass) self._name = name self._state = initial self._entity_config = entity_config
Example #6
Source File: __init__.py From common_timer with Apache License 2.0 | 5 votes |
def async_setup(hass, config): """Set up an input boolean.""" component = hass.data[DOMAIN] = EntityComponent(_LOGGER, DOMAIN, hass) entities = [] for object_id, cfg in config[DOMAIN].items(): if not cfg: cfg = {} name = cfg.get(CONF_NAME) initial = cfg.get(CONF_INITIAL) icon = cfg.get(CONF_ICON) entities.append(InputBoolean(object_id, name, initial, icon)) if not entities: return False component.async_register_entity_service( SERVICE_TURN_ON, SERVICE_SCHEMA, 'async_turn_on' ) component.async_register_entity_service( SERVICE_TURN_OFF, SERVICE_SCHEMA, 'async_turn_off' ) component.async_register_entity_service( SERVICE_TOGGLE, SERVICE_SCHEMA, 'async_toggle' ) await component.async_add_entities(entities) return True
Example #7
Source File: __init__.py From common_timer with Apache License 2.0 | 5 votes |
def __init__(self, object_id, name, initial, icon): """Initialize a boolean input.""" self.entity_id = ENTITY_ID_FORMAT.format(object_id) self._name = name self._state = initial self._icon = icon
Example #8
Source File: __init__.py From common_timer with Apache License 2.0 | 5 votes |
def name(self): """Return name of the boolean input.""" return self._name