temperature_host: Improve backwards compatibility check
Don't register two names for the same instance of the sensor. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
3d35c003db
commit
227d9bdbcf
|
@ -18,7 +18,10 @@ class Temperature_HOST:
|
||||||
|
|
||||||
self.temp = self.min_temp = self.max_temp = 0.0
|
self.temp = self.min_temp = self.max_temp = 0.0
|
||||||
|
|
||||||
self.printer.add_object("rpi_temperature " + self.name, self) # XXX
|
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)
|
self.printer.add_object("temperature_host " + self.name, self)
|
||||||
if self.printer.get_start_args().get('debugoutput') is not None:
|
if self.printer.get_start_args().get('debugoutput') is not None:
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue