temperature_sensor: Add get_status() function

Provide printer.<sensor-config-name>.temperature variable to gcode macro
environment

Signed-off-by: Simon Kühling <mail@simonkuehling.de>
This commit is contained in:
Simon Kühling 2019-12-13 15:13:36 +01:00 committed by KevinOConnor
parent 2721211456
commit b1bbe97576
1 changed files with 2 additions and 0 deletions

View File

@ -22,6 +22,8 @@ class PrinterSensorGeneric:
self.last_temp = temp self.last_temp = temp
def get_temp(self, eventtime): def get_temp(self, eventtime):
return self.last_temp, 0. return self.last_temp, 0.
def get_status(self, eventtime):
return {'temperature': self.last_temp}
def load_config_prefix(config): def load_config_prefix(config):
return PrinterSensorGeneric(config) return PrinterSensorGeneric(config)