Class KobotSelectEntity
-
- All Implemented Interfaces:
-
crackers.kobots.mqtt.homeassistant.KobotHAEntity,kotlin.Comparable
public class KobotSelectEntity extends CommandEntity
A "select" entity allows for a device to react to explicit "commands". This conforms to the MQTT Select
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classKobotSelectEntity.Companion
-
Field Summary
Fields Modifier and Type Field Description private final Stringcomponentprivate final Stringiconprivate final KobotSelectEntity.Companion.SelectHandlerselectHandlerprivate final StringcommandTopicprivate final StringstatusTopicprivate final StringuniqueIdprivate final Stringnameprivate final DeviceIdentifierdeviceIdentifierpublic final static KobotSelectEntity.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description KobotSelectEntity(KobotSelectEntity.Companion.SelectHandler selectHandler, 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 KobotSelectEntity.Companion.SelectHandlergetSelectHandler()JSONObjectdiscovery()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. UnitsetOption(String option)Programmatically set the option for this select entity. 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
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
-
KobotSelectEntity
KobotSelectEntity(KobotSelectEntity.Companion.SelectHandler selectHandler, String uniqueId, String name, DeviceIdentifier deviceIdentifier)
-
-
Method Detail
-
getComponent
String getComponent()
The Home Assistant classification of the device (e.g. light, switch, etc.)
-
getSelectHandler
final KobotSelectEntity.Companion.SelectHandler getSelectHandler()
-
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.
-
setOption
Unit setOption(String option)
Programmatically set the option for this select entity. If
optionisnull, then the option is set to "None" and no action is taken.
-
currentState
String currentState()
Generate the MQTT state message for this device.
-
handleCommand
Unit handleCommand(String payload)
Handle the MQTT command message for this device.
-
-
-
-