From 227d9bdbcfd8ad8b62fb10db48f2482b9900592f Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 19 Feb 2021 18:51:42 -0500 Subject: [PATCH] temperature_host: Improve backwards compatibility check Don't register two names for the same instance of the sensor. Signed-off-by: Kevin O'Connor --- klippy/extras/temperature_host.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/klippy/extras/temperature_host.py b/klippy/extras/temperature_host.py index 98f29a87..e0a665a9 100644 --- a/klippy/extras/temperature_host.py +++ b/klippy/extras/temperature_host.py @@ -18,8 +18,11 @@ class Temperature_HOST: self.temp = self.min_temp = self.max_temp = 0.0 - self.printer.add_object("rpi_temperature " + self.name, self) # XXX - self.printer.add_object("temperature_host " + self.name, self) + if config.get("sensor_type", "", note_valid=False).startswith('rpi'): + # Temporary backwards compatibility + self.printer.add_object("rpi_temperature " + self.name, self) + else: + self.printer.add_object("temperature_host " + self.name, self) if self.printer.get_start_args().get('debugoutput') is not None: return self.sample_timer = self.reactor.register_timer(