MQTT Home Emulation
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223
  1. import devices.base
  2. import devices.livarno
  3. import devices.shelly
  4. import devices.tradfri
  5. class null(devices.base.base):
  6. """A dummy device for not yet existing devicetypes
  7. Args:
  8. mqtt_client (mqtt.mqtt_client): A MQTT Client instance
  9. topic (str): the base topic for this device
  10. """
  11. def __init__(self, mqtt_client, topic, **kwargs):
  12. super().__init__(mqtt_client, topic, **kwargs)
  13. self.mqtt_client.add_callback(self.topic, self.__rx__)
  14. self.mqtt_client.add_callback(self.topic + '/#', self.__rx__)
  15. def __rx__(self, client, userdata, message):
  16. self.logger.warning("Got messaqge for device with missing implementation: topic=%s, payload=%s", message.topic, repr(message.payload))
  17. def set_state(self, value):
  18. self.logger.warning("Got set_state call for device with missing implementation.")