30 lines
1.3 KiB
Plaintext
30 lines
1.3 KiB
Plaintext
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 |