From 747e2cd91c56417c1d51fe46df1bf40595a6ff32 Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Thu, 24 Mar 2016 21:34:14 +0000 Subject: [PATCH] Prepared the code to accept the fact that no bed temperatures may be given with _printer. This fixes #11. --- octoprint_telegram/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/octoprint_telegram/__init__.py b/octoprint_telegram/__init__.py index 1d02546..9ccea00 100644 --- a/octoprint_telegram/__init__.py +++ b/octoprint_telegram/__init__.py @@ -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