Class KobotAnalogSensor
-
- All Implemented Interfaces:
-
crackers.kobots.mqtt.homeassistant.KobotHAEntity
,kotlin.Comparable
public class KobotAnalogSensor extends KobotSensor<KobotAnalogSensor.Companion.AnalogDevice, String>
Analog (value) sensor, single state. Note that any value that specifies a deviceClass will be expected to provide the appropriate unitOfMeasurement: e.g.
current
requires either "mA" or "A" for units. These are defined at the device-class page.Any value to be transmitted must be pre-converted to the appropriate string.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
KobotAnalogSensor.Companion
-
Field Summary
Fields Modifier and Type Field Description private final String
component
private final String
icon
private String
currentState
private final KobotAnalogSensor.Companion.StateClass
stateClass
private final String
unitOfMeasurement
private final Integer
suggestedPrecision
private final KobotAnalogSensor.Companion.AnalogDevice
deviceClass
private final String
statusTopic
private final String
uniqueId
private final String
name
private final DeviceIdentifier
deviceIdentifier
public final static KobotAnalogSensor.Companion
Companion
-
Constructor Summary
Constructors Constructor Description KobotAnalogSensor(String uniqueId, String name, DeviceIdentifier deviceIdentifier, KobotAnalogSensor.Companion.AnalogDevice deviceClass, Duration expires, KobotAnalogSensor.Companion.StateClass stateClass, String unitOfMeasurement, Integer suggestedPrecision)
-
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. String
getCurrentState()
Unit
setCurrentState(String currentState)
final KobotAnalogSensor.Companion.StateClass
getStateClass()
final String
getUnitOfMeasurement()
final Integer
getSuggestedPrecision()
<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
-
KobotAnalogSensor
KobotAnalogSensor(String uniqueId, String name, DeviceIdentifier deviceIdentifier, KobotAnalogSensor.Companion.AnalogDevice deviceClass, Duration expires, KobotAnalogSensor.Companion.StateClass stateClass, String unitOfMeasurement, Integer suggestedPrecision)
-
-
Method Detail
-
getComponent
final String getComponent()
The Home Assistant classification of the device (e.g. light, switch, etc.)
-
getCurrentState
String getCurrentState()
-
setCurrentState
Unit setCurrentState(String currentState)
-
getStateClass
final KobotAnalogSensor.Companion.StateClass getStateClass()
-
getUnitOfMeasurement
final String getUnitOfMeasurement()
-
getSuggestedPrecision
final Integer getSuggestedPrecision()
-
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.
-
-
-
-