Fix error where API state is requested and printer is offline

(cherry picked from commit 619fe9a)
This commit is contained in:
C-o-r-E authored and Gina Häußge committed 2015-01-12 16:53:17 +01:00
1 parent 87ddcac2fc
commit 684d12e60e
1 file changed
+7 -6
+7 -6
View File
@@ -628,12 +628,13 @@ class Printer():
bedTempOffset = None
result = {}
for tool in self._temp.keys():
result["tool%d" % tool] = {
"actual": self._temp[tool][0],
"target": self._temp[tool][1],
"offset": tempOffset[tool] if tool in tempOffset.keys() and tempOffset[tool] is not None else 0
}
if self._temp is not None:
for tool in self._temp.keys():
result["tool%d" % tool] = {
"actual": self._temp[tool][0],
"target": self._temp[tool][1],
"offset": tempOffset[tool] if tool in tempOffset.keys() and tempOffset[tool] is not None else 0
}
if self._bedTemp is not None:
result["bed"] = {
"actual": self._bedTemp[0],