Interface KobotHAEntity
-
- All Implemented Interfaces:
-
kotlin.Comparable
public interface KobotHAEntity implements Comparable<KobotHAEntity>
Defines the "device" for MQTT discovery and state messages.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classKobotHAEntity.Companion
-
Method Summary
Modifier and Type Method Description abstract JSONObjectdiscovery()Generate the MQTT discovery message for this device. abstract StringcurrentState()Generate the MQTT state message for this device. IntegercompareTo(KobotHAEntity other)abstract StringgetUniqueId()The unique ID of the device. abstract StringgetName()The friendly name of the device. abstract StringgetComponent()The Home Assistant classification of the device (e.g. abstract DeviceIdentifiergetDeviceIdentifier()More detailed information about the device. abstract StringgetIcon()The icon HA will use to display this entity. -
-
Method Detail
-
discovery
abstract JSONObject discovery()
Generate the MQTT discovery message for this device.
NOTE This should be modified by each entity for its special cases.
-
currentState
abstract String currentState()
Generate the MQTT state message for this device.
-
compareTo
Integer compareTo(KobotHAEntity other)
-
getUniqueId
abstract String getUniqueId()
The unique ID of the device. NOTE If this is not unique across all devices, then HomeAssistant will throw an error on discovery, but it wont be seen here.
-
getName
abstract String getName()
The friendly name of the device. This may be renamed in the HomeAssistant UI.
-
getComponent
abstract String getComponent()
The Home Assistant classification of the device (e.g. light, switch, etc.)
-
getDeviceIdentifier
abstract DeviceIdentifier getDeviceIdentifier()
More detailed information about the device.
-
-
-
-