當前位置: 首頁>>代碼示例>>Python>>正文


Python config_validation.boolean方法代碼示例

本文整理匯總了Python中homeassistant.helpers.config_validation.boolean方法的典型用法代碼示例。如果您正苦於以下問題:Python config_validation.boolean方法的具體用法?Python config_validation.boolean怎麽用?Python config_validation.boolean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在homeassistant.helpers.config_validation的用法示例。


在下文中一共展示了config_validation.boolean方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: create_parameters1cv

# 需要導入模塊: from homeassistant.helpers import config_validation [as 別名]
# 或者: from homeassistant.helpers.config_validation import boolean [as 別名]
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
    } 
開發者ID:davesmeghead,項目名稱:visonic,代碼行數:13,代碼來源:create_schema.py

示例2: create_parameters2cv

# 需要導入模塊: from homeassistant.helpers import config_validation [as 別名]
# 或者: from homeassistant.helpers.config_validation import boolean [as 別名]
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
    } 
開發者ID:davesmeghead,項目名稱:visonic,代碼行數:16,代碼來源:create_schema.py

示例3: create_parameters3cv

# 需要導入模塊: from homeassistant.helpers import config_validation [as 別名]
# 或者: from homeassistant.helpers.config_validation import boolean [as 別名]
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
    } 
開發者ID:davesmeghead,項目名稱:visonic,代碼行數:13,代碼來源:create_schema.py

示例4: create_parameters4cv

# 需要導入模塊: from homeassistant.helpers import config_validation [as 別名]
# 或者: from homeassistant.helpers.config_validation import boolean [as 別名]
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
    } 
開發者ID:davesmeghead,項目名稱:visonic,代碼行數:9,代碼來源:create_schema.py

示例5: __init__

# 需要導入模塊: from homeassistant.helpers import config_validation [as 別名]
# 或者: from homeassistant.helpers.config_validation import boolean [as 別名]
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 
開發者ID:TomerFi,項目名稱:home-assistant-custom-components,代碼行數:9,代碼來源:__init__.py

示例6: async_setup

# 需要導入模塊: from homeassistant.helpers import config_validation [as 別名]
# 或者: from homeassistant.helpers.config_validation import boolean [as 別名]
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 
開發者ID:cnk700i,項目名稱:common_timer,代碼行數:38,代碼來源:__init__.py

示例7: __init__

# 需要導入模塊: from homeassistant.helpers import config_validation [as 別名]
# 或者: from homeassistant.helpers.config_validation import boolean [as 別名]
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 
開發者ID:cnk700i,項目名稱:common_timer,代碼行數:8,代碼來源:__init__.py

示例8: name

# 需要導入模塊: from homeassistant.helpers import config_validation [as 別名]
# 或者: from homeassistant.helpers.config_validation import boolean [as 別名]
def name(self):
        """Return name of the boolean input."""
        return self._name 
開發者ID:cnk700i,項目名稱:common_timer,代碼行數:5,代碼來源:__init__.py


注:本文中的homeassistant.helpers.config_validation.boolean方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。