本文整理匯總了Python中homeassistant.helpers.config_validation.positive_int方法的典型用法代碼示例。如果您正苦於以下問題:Python config_validation.positive_int方法的具體用法?Python config_validation.positive_int怎麽用?Python config_validation.positive_int使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類homeassistant.helpers.config_validation
的用法示例。
在下文中一共展示了config_validation.positive_int方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: create_parameters2cv
# 需要導入模塊: from homeassistant.helpers import config_validation [as 別名]
# 或者: from homeassistant.helpers.config_validation import positive_int [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
}
示例2: create_parameters3cv
# 需要導入模塊: from homeassistant.helpers import config_validation [as 別名]
# 或者: from homeassistant.helpers.config_validation import positive_int [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
}
示例3: create_parameters4cv
# 需要導入模塊: from homeassistant.helpers import config_validation [as 別名]
# 或者: from homeassistant.helpers.config_validation import positive_int [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
}
示例4: __init__
# 需要導入模塊: from homeassistant.helpers import config_validation [as 別名]
# 或者: from homeassistant.helpers.config_validation import positive_int [as 別名]
def __init__(self):
"""Initialize the config flow."""
self.login = None
self.config = OrderedDict()
self.data_schema = OrderedDict(
[
(vol.Required(CONF_EMAIL), str),
(vol.Required(CONF_PASSWORD), str),
(vol.Required(CONF_URL, default="amazon.com"), str),
(vol.Optional(CONF_DEBUG, default=False), bool),
(vol.Optional(CONF_INCLUDE_DEVICES, default=""), str),
(vol.Optional(CONF_EXCLUDE_DEVICES, default=""), str),
(vol.Optional(CONF_SCAN_INTERVAL, default=60), int),
]
)
self.captcha_schema = OrderedDict(
[(vol.Required(CONF_PASSWORD), str), (vol.Required("captcha"), str)]
)
self.twofactor_schema = OrderedDict([(vol.Required("securitycode"), str)])
self.claimspicker_schema = OrderedDict(
[
(
vol.Required("claimsoption", default=0),
vol.All(cv.positive_int, vol.Clamp(min=0)),
)
]
)
self.authselect_schema = OrderedDict(
[
(
vol.Required("authselectoption", default=0),
vol.All(cv.positive_int, vol.Clamp(min=0)),
)
]
)
self.verificationcode_schema = OrderedDict(
[(vol.Required("verificationcode"), str)]
)