Commit Iniziale, progetto funzionante caricato su box ETcontroller in
cantina
This commit is contained in:
30
out
Normal file
30
out
Normal file
@@ -0,0 +1,30 @@
|
||||
LOGGER.debug("RECV ==>%s< " % message)
|
||||
|
||||
if "POLL" in message:
|
||||
''' Poll message: reset counter for ETcontroller timeout '''
|
||||
etctrl_tmo = 0
|
||||
elif 'ACK' in message[:2]:
|
||||
''' this is correct answer to setting HP inputs '''
|
||||
LOGGER.debug("Received ACK")
|
||||
elif 'NAK' in message[:2]:
|
||||
''' this is wrong answer to ETcontroller '''
|
||||
LOGGER.error("ETcontroller received a wrong parameters for command")
|
||||
elif 'NC' in message[:1]:
|
||||
''' this is wrong answer to ETcontroller '''
|
||||
LOGGER.error("ETcontroller received a wrong parameters for command")
|
||||
elif 'HP_O' in message[:3]:
|
||||
''' this is correct answer to setting HP inputs '''
|
||||
HP_pwset = (message.split(':'))[1]
|
||||
LOGGER.debug("Actual HP power setting is: P:%s" % str(HP_pwset))
|
||||
elif 'WT_T' in message:
|
||||
''' this is correct answer to setting HP inputs '''
|
||||
WT_atemp = float((message.split(':'))[1])
|
||||
LOGGER.debug("Actual Water tank temperature is: %s" % str(WT_atemp))
|
||||
elif 'HP_W' in message:
|
||||
''' this the actual power consuption answer '''
|
||||
HP_pwget = float((message.split(':'))[1])
|
||||
LOGGER.debug("Actual HP instant power is %s" % str(PW_pwget))
|
||||
else:
|
||||
LOGGER.warning("unexpected response from ETController: >%s<" % str(message))
|
||||
pass
|
||||
return
|
||||
Reference in New Issue
Block a user