def SensorUpdated(sender, **kwargs): CheckThermostats.delay(sensor=kwargs["instance"]) if kwargs["instance"].temperature is not None: kwargs["instance"].temperature = float(kwargs["instance"].temperature) publish( "pimostat", "sensor-%d" % kwargs["instance"].pk, {"temperature": kwargs["instance"].temperature})
def ThermostatUpdated(sender, **kwargs): CheckThermostats.delay()