Class KobotSensor
-
- All Implemented Interfaces:
-
crackers.kobots.mqtt.homeassistant.KobotHAEntity,kotlin.Comparable
public abstract class KobotSensor<M extends DeviceClass, T extends Object> extends AbstractKobotEntity
Basic sensor stuff. Updates are controlled by setting the sensor's current state
-
-
Field Summary
Fields Modifier and Type Field Description private TcurrentStateprivate final MdeviceClassprivate final Stringiconprivate final StringstatusTopicprivate final StringuniqueIdprivate final Stringnameprivate final DeviceIdentifierdeviceIdentifierprivate final Stringcomponent
-
Constructor Summary
Constructors Constructor Description KobotSensor(String uniqueId, String name, DeviceIdentifier deviceIdentifier, Duration expires, M deviceClass)
-
Method Summary
Modifier and Type Method Description abstract TgetCurrentState()abstract UnitsetCurrentState(T currentState)final MgetDeviceClass()StringcurrentState()Generate the MQTT state message for this device. <Error class: unknown class>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, start -
Methods inherited from class crackers.kobots.mqtt.homeassistant.KobotHAEntity
compareTo, getComponent -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
KobotSensor
KobotSensor(String uniqueId, String name, DeviceIdentifier deviceIdentifier, Duration expires, M deviceClass)
-
-
Method Detail
-
getCurrentState
abstract T getCurrentState()
-
setCurrentState
abstract Unit setCurrentState(T currentState)
-
getDeviceClass
final M getDeviceClass()
-
currentState
String currentState()
Generate the MQTT state message for this device.
-
discovery
<Error class: unknown class> 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.
-
-
-
-