本文整理匯總了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"])