Class KobotTextEntity
-
- All Implemented Interfaces:
-
crackers.kobots.mqtt.homeassistant.KobotHAEntity,kotlin.Comparable
public class KobotTextEntity extends CommandEntity
Handles simple text messages.
-
-
Field Summary
Fields Modifier and Type Field Description private final Stringcomponentprivate final Stringiconprivate final Function1<String, Unit>textHandlerprivate final StringcommandTopicprivate final StringstatusTopicprivate final StringuniqueIdprivate final Stringnameprivate final DeviceIdentifierdeviceIdentifier
-
Constructor Summary
Constructors Constructor Description KobotTextEntity(Function1<String, Unit> textHandler, String uniqueId, String name, DeviceIdentifier deviceIdentifier)
-
Method Summary
Modifier and Type Method Description StringgetComponent()The Home Assistant classification of the device (e.g. StringgetIcon()The icon HA will use to display this entity. final Function1<String, Unit>getTextHandler()StringcurrentState()Generate the MQTT state message for this device. UnithandleCommand(String payload)Handle the MQTT command message for this device. -
Methods inherited from class crackers.kobots.mqtt.homeassistant.CommandEntity
discovery, getCommandTopic, start -
Methods inherited from class crackers.kobots.mqtt.homeassistant.AbstractKobotEntity
getDeviceIdentifier, getName, getStatusTopic, getUniqueId, remove, sendCurrentState -
Methods inherited from class crackers.kobots.mqtt.homeassistant.KobotHAEntity
compareTo -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
KobotTextEntity
KobotTextEntity(Function1<String, Unit> textHandler, String uniqueId, String name, DeviceIdentifier deviceIdentifier)
-
-
Method Detail
-
getComponent
String getComponent()
The Home Assistant classification of the device (e.g. light, switch, etc.)
-
getTextHandler
final Function1<String, Unit> getTextHandler()
-
currentState
String currentState()
Generate the MQTT state message for this device.
-
handleCommand
Unit handleCommand(String payload)
Handle the MQTT command message for this device.
-
-
-
-