本文整理汇总了Python中lib.GlobalData.timeDelayedActivation方法的典型用法代码示例。如果您正苦于以下问题:Python GlobalData.timeDelayedActivation方法的具体用法?Python GlobalData.timeDelayedActivation怎么用?Python GlobalData.timeDelayedActivation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib.GlobalData
的用法示例。
在下文中一共展示了GlobalData.timeDelayedActivation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AudioOutput
# 需要导入模块: from lib import GlobalData [as 别名]
# 或者: from lib.GlobalData import timeDelayedActivation [as 别名]
audioActivated = (str(
configRoot.find("manager").find("audio").attrib[
"enabled"]).upper() == "TRUE")
audioPlaySilence = (str(
configRoot.find("manager").find("audio").attrib[
"playSilence"]).upper() == "TRUE")
if audioActivated is True:
globalData.audioOutput = AudioOutput()
# Play silence as a workaround for HDMI delays.
if audioPlaySilence is True:
globalData.audioOutput.playSilence()
# get settings for the keypad
globalData.timeDelayedActivation = int(
configRoot.find("manager").find("keypad").attrib[
"timeDelayedActivation"])
# parse all pins
for item in configRoot.find("manager").find("keypad").iterfind("pin"):
globalData.pins.append(item.text)
if not globalData.pins:
raise ValueError("No PIN configured.")
# parse all sensor warning states
for item in configRoot.find("manager").find(
"sensorwarningstates").iterfind("sensor"):
temp = SensorWarningState()
temp.username = str(item.attrib["username"])
temp.remoteSensorId = int(item.attrib["remoteSensorId"])