Class CommandEntity

  • All Implemented Interfaces:
    crackers.kobots.mqtt.homeassistant.KobotHAEntity , kotlin.Comparable

    
    public abstract class CommandEntity
    extends AbstractKobotEntity
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      String getCommandTopic() The MQTT topic for the devices command (receive).
      abstract Unit handleCommand(String payload) Handle the MQTT command message for this device.
      Unit start() Over-ride the base class to add a subscription to handle commands.
      JSONObject discovery() A generic configuration for the device, which can be used to generate the discovery message because there are too many "base" configuration parameters to be able to handle them cleanly, so just dump it on the child class to figure it out.
      • Methods inherited from class crackers.kobots.mqtt.homeassistant.AbstractKobotEntity

        getDeviceIdentifier, getIcon, getName, getStatusTopic, getUniqueId, remove, sendCurrentState
      • Methods inherited from class crackers.kobots.mqtt.homeassistant.KobotHAEntity

        compareTo, currentState, getComponent
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getCommandTopic

         String getCommandTopic()

        The MQTT topic for the devices command (receive). Allows over-rides.

      • start

         Unit start()

        Over-ride the base class to add a subscription to handle commands. This also "automatically" sends a current state once the handler has finished.

      • discovery

         JSONObject discovery()

        A generic configuration for the device, which can be used to generate the discovery message because there are too many "base" configuration parameters to be able to handle them cleanly, so just dump it on the child class to figure it out.