stephenmhall / PiHeating

python code for Raspberry Pi Heating control
3 stars 2 forks source link

KeyError on room with 0.0 temp #2

Open asantaga opened 7 years ago

asantaga commented 7 years ago

webui.py got

self.switchHeat() File "H:/src/PiHeating/PiHeating\max.py", line 486, in switchHeat roomTemps = CreateUIPage().createRooms() File "H:/src/PiHeating/PiHeating\webui.py", line 215, in createRooms actualTemp = goodTemps[roomText] KeyError: u'Utility Room'

fixed this by changing line 215 from

actualTemp = goodTemps[roomText] to actualTemp = goodTemps.get(roomText, 0)