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 classKobotBinarySensor.Companion
-
Field Summary
Fields Modifier and Type Field Description private final Stringcomponentprivate final Stringiconprivate BooleancurrentStateprivate final DurationoffDelayprivate final KobotBinarySensor.Companion.BinaryDevicedeviceClassprivate final StringstatusTopicprivate final StringuniqueIdprivate final Stringnameprivate final DeviceIdentifierdeviceIdentifierpublic final static KobotBinarySensor.CompanionCompanion
-
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 StringgetComponent()The Home Assistant classification of the device (e.g. StringgetIcon()The icon HA will use to display this entity. BooleangetCurrentState()UnitsetCurrentState(Boolean currentState)final DurationgetOffDelay()<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.
-
-
-
-