heaters: add last pwm value to heater.get_status (#3621)

Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
Stefan Dej 2020-12-14 02:08:16 +01:00 committed by GitHub
parent 43a6d18f13
commit 77add95675
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -135,7 +135,9 @@ class Heater:
with self.lock:
target_temp = self.target_temp
smoothed_temp = self.smoothed_temp
return {'temperature': smoothed_temp, 'target': target_temp}
last_pwm_value = self.last_pwm_value
return {'temperature': smoothed_temp, 'target': target_temp,
'power': last_pwm_value}
cmd_SET_HEATER_TEMPERATURE_help = "Sets a heater temperature"
def cmd_SET_HEATER_TEMPERATURE(self, gcmd):
temp = gcmd.get_float('TARGET', 0.)