Class KobotNumberEntity
-
- All Implemented Interfaces:
-
crackers.kobots.mqtt.homeassistant.KobotHAEntity
,kotlin.Comparable
public class KobotNumberEntity extends CommandEntity
HA has an easy way to "send" numbers as commands: this aligns really well with things like
Rotator
andLinearActuator
devices.There are quite a few UI hints that can be set on these objects; defaults are set in all cases.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
KobotNumberEntity.Companion
-
Field Summary
Fields Modifier and Type Field Description private final String
component
private final String
icon
private final String
commandTopic
private final String
statusTopic
private final String
uniqueId
private final String
name
private final DeviceIdentifier
deviceIdentifier
public final static KobotNumberEntity.Companion
Companion
-
Constructor Summary
Constructors Constructor Description KobotNumberEntity(KobotNumberEntity.Companion.NumberHandler handler, String uniqueId, String name, DeviceIdentifier deviceIdentifier, KobotNumberEntity.Companion.NumericDevice deviceClass, Integer min, Integer max, KobotNumberEntity.Companion.DisplayMode mode, Float step, String unitOfMeasurement)
-
Method Summary
Modifier and Type Method Description String
getComponent()
The Home Assistant classification of the device (e.g. String
getIcon()
The icon HA will use to display this entity. 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. String
currentState()
Generate the MQTT state message for this device. Unit
handleCommand(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
-
KobotNumberEntity
KobotNumberEntity(KobotNumberEntity.Companion.NumberHandler handler, String uniqueId, String name, DeviceIdentifier deviceIdentifier, KobotNumberEntity.Companion.NumericDevice deviceClass, Integer min, Integer max, KobotNumberEntity.Companion.DisplayMode mode, Float step, String unitOfMeasurement)
-
-
Method Detail
-
getComponent
String getComponent()
The Home Assistant classification of the device (e.g. light, switch, etc.)
-
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.
-
currentState
String currentState()
Generate the MQTT state message for this device.
-
handleCommand
Unit handleCommand(String payload)
Handle the MQTT command message for this device.
-
-
-
-