本文整理汇总了Python中jsonrpclib.Server.relay_set方法的典型用法代码示例。如果您正苦于以下问题:Python Server.relay_set方法的具体用法?Python Server.relay_set怎么用?Python Server.relay_set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jsonrpclib.Server
的用法示例。
在下文中一共展示了Server.relay_set方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OpenBCcfg
# 需要导入模块: from jsonrpclib import Server [as 别名]
# 或者: from jsonrpclib.Server import relay_set [as 别名]
CFG = os.path.dirname(os.path.abspath(__file__)) + CFG_PATH + CFG_FILE
OB = OpenBCcfg(CFG)
OB.readConfigFile() # Read config file.
time.sleep(2)
S = Server(OB.EVOK_URL) # Connection to evok api
TIMESTAMP_CFG = time.ctime(os.path.getmtime(CFG))
TEMP_SCREW_BLOCK_TIMER = time.time() # Read current time, need this for screw controll
TEMP_LOG_BLOCK_TIMER = time.time()
TIME_LEFT_OF_BLOCK_TIMER = 0
# Make sure all relay is deactivated
for x in xrange(1,9):
S.relay_set(x, 0)
# Init Log (/tmp/openBC.log)
logging.basicConfig(filename=OB.LOG_BASE_DIR + OB.LOG_FILE_NAME, format='%(asctime)s %(levelname)s %(message)s', level=logging.DEBUG)
logging.info('%s', 'Start!')
# Create instances.
TANK = TempSensor(S, OB.TANK_TEMP_SENSOR_ID)
BOILER = TempSensor(S, OB.BOILER_TEMP_SENSOR_ID)
# FALLBACK_TEMP = TempSensor(S, "286B075005000099")
FIRE = FireSensor(S, OB.FIRE_TEMP_SENSOR_ANALOG_PIN)
FAN = AnalogOut(S, OB.FAN_CONTACTOR_PIN, OB.FAN_ANALOG_PIN)
SOND = SerialLambda(S, OB.LAMBDA_SENSOR_CONTACTOR_PIN, OB.LAMBDA_SENSOR_TYPE, OB.LAMBDA_SENSOR_PORT, OB.LAMBDA_SENSOR_BAUD, int(OB.LAMBDA_SENSOR_SYNC_HEADER_ATTEMPT))
SCREW = Screw(S, OB.SCREW_CONTACTOR_PIN)
HMI = Hmi(S, OB.BUTTON_CONTACTOR_PIN)