Class KobotAnalogSensor
-
- All Implemented Interfaces:
-
crackers.kobots.mqtt.homeassistant.KobotHAEntity,kotlin.Comparable
public class KobotAnalogSensor extends KobotSensor<KobotAnalogSensor.Companion.AnalogDevice, Double>
Analog (value) sensor, single state. Note that any value that specifies a deviceClass will be expected to provide the appropriate unitOfMeasurement: e.g.
currentrequires 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 classKobotAnalogSensor.Companion
-
Field Summary
Fields Modifier and Type Field Description private final Stringcomponentprivate final Stringiconprivate DoublecurrentStateprivate final KobotAnalogSensor.Companion.StateClassstateClassprivate final StringunitOfMeasurementprivate final IntegersuggestedPrecisionprivate final KobotAnalogSensor.Companion.AnalogDevicedeviceClassprivate final StringstatusTopicprivate final StringuniqueIdprivate final Stringnameprivate final DeviceIdentifierdeviceIdentifierpublic final static KobotAnalogSensor.CompanionCompanion
-
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 StringgetComponent()The Home Assistant classification of the device (e.g. StringgetIcon()The icon HA will use to display this entity. DoublegetCurrentState()UnitsetCurrentState(Double currentState)final KobotAnalogSensor.Companion.StateClassgetStateClass()final StringgetUnitOfMeasurement()final IntegergetSuggestedPrecision()<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
Double getCurrentState()
-
setCurrentState
Unit setCurrentState(Double 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.
-
-
-
-