Class KobotBinarySensor
-
- All Implemented Interfaces:
-
crackers.kobots.mqtt.homeassistant.KobotHAEntity
,kotlin.Comparable
public class KobotBinarySensor extends KobotSensor<KobotBinarySensor.Companion.BinaryDevice, Boolean>
On/off sensor, single state. If the deviceClass is set, Home Assistant will pick the appropriate "type" of binary sensor.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
KobotBinarySensor.Companion
-
Field Summary
Fields Modifier and Type Field Description private final String
component
private final String
icon
private Boolean
currentState
private final Duration
offDelay
private final KobotBinarySensor.Companion.BinaryDevice
deviceClass
private final String
statusTopic
private final String
uniqueId
private final String
name
private final DeviceIdentifier
deviceIdentifier
public final static KobotBinarySensor.Companion
Companion
-
Constructor Summary
Constructors Constructor Description KobotBinarySensor(String uniqueId, String name, DeviceIdentifier deviceIdentifier, KobotBinarySensor.Companion.BinaryDevice deviceClass, Duration expires, Duration offDelay)
-
Method Summary
Modifier and Type Method Description final String
getComponent()
The Home Assistant classification of the device (e.g. String
getIcon()
The icon HA will use to display this entity. Boolean
getCurrentState()
Unit
setCurrentState(Boolean currentState)
final Duration
getOffDelay()
<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.KobotSensor
currentState, getDeviceClass
-
Methods inherited from class crackers.kobots.mqtt.homeassistant.AbstractKobotEntity
getDeviceIdentifier, getName, getStatusTopic, getUniqueId, remove, sendCurrentState, start
-
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
-
KobotBinarySensor
KobotBinarySensor(String uniqueId, String name, DeviceIdentifier deviceIdentifier, KobotBinarySensor.Companion.BinaryDevice deviceClass, Duration expires, Duration offDelay)
-
-
Method Detail
-
getComponent
final String getComponent()
The Home Assistant classification of the device (e.g. light, switch, etc.)
-
getCurrentState
Boolean getCurrentState()
-
setCurrentState
Unit setCurrentState(Boolean currentState)
-
getOffDelay
final Duration getOffDelay()
-
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.
-
-
-
-