Skip to content

Commit

Permalink
Prepared the code to accept the fact that no bed temperatures may be …
Browse files Browse the repository at this point in the history
…given with _printer. This fixes #11.
  • Loading branch information
fabianonline committed Mar 24, 2016
1 parent af4731d commit 747e2cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions octoprint_telegram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ def on_event(self, event, payload, *args, **kwargs):
self._logger.debug(str(status))
temps = self._printer.get_current_temperatures()
self._logger.debug(str(temps))
bed_temp = temps['bed']['actual']
bed_target = temps['bed']['target']
bed_temp = temps['bed']['actual'] if 'bed' in temps else 0.0
bed_target = temps['bed']['target'] if 'bed' in temps else 0.0
e1_temp = temps['tool0']['actual']
e1_target = temps['tool0']['target']
e2_temp = e2_target = None
Expand Down

0 comments on commit 747e2cd

Please sign in to comment.