Fixing nagging bug

This commit is contained in:
Max 2021-01-02 20:38:03 +00:00
parent 9a5f7b9e6b
commit 3f775aeb91
2 changed files with 7 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -74,12 +74,16 @@ class Master:
def get_temp(self):
temp = self.com.send_and_wait('iot_g_temp|')
logging.info(f'Got temp from slave: {temp}ºC')
return float("{:.1f}".format(float(temp.decode())))
if temp:
return float("{:.1f}".format(float(temp.decode())))
return False
def get_hmdt(self):
hmdt = self.com.send_and_wait('iot_g_hmdt|')
logging.info(f'Got hmdt from slave: {hmdt}')
return int(hmdt.decode())
if hmdt:
return int(hmdt.decode())
return False
def run_pump(self, volume):
status = self.com.send_and_wait(f'iot_pmp_ctrl|{str(volume)}')