esp8266_web_settings beta
|
A sensor definition to be published to MQTT. More...
#include <grmcdorman/device/Device.h>
Public Member Functions | |
virtual const __FlashStringHelper * | get_name_suffix () const =0 |
Get the name suffix. More... | |
virtual const __FlashStringHelper * | get_value_template () const =0 |
Get the value template. More... | |
virtual const __FlashStringHelper * | get_unique_id_suffix () const =0 |
Get the unique id suffix. More... | |
virtual const __FlashStringHelper * | get_unit_of_measurement () const =0 |
Get the unit of measurement. More... | |
virtual const __FlashStringHelper * | get_json_attributes_template () const =0 |
Get the json attributes template. More... | |
virtual const __FlashStringHelper * | get_icon () const =0 |
Get the icon. More... | |
A sensor definition to be published to MQTT.
This allows MQTT listeners, such as Home Assistant, to automatically discover and recognize the sensor. It also provides the definitions to be used for publishing the device data.
|
pure virtual |
Get the icon.
This is the icon to be used by applications like Home Assistant. Examples include "mdi:wifi".
|
pure virtual |
Get the json attributes template.
Attributes are additional values other than the primary value; this describes where they are in the JSON. This should be a null (nullptr
) if there are no attributes.
Examples include SSID for the WiFi RSSI value.
|
pure virtual |
Get the name suffix.
The unique ESP identifer is suffixed with this to generate a unique human-readable device name.
|
pure virtual |
Get the unique id suffix.
The unique ESP identifier is suffixed with this to generate a unique system-wide sensor identifier. Unlike the name
value, this is not human-readable and should follow identifier rules.
|
pure virtual |
Get the unit of measurement.
The units for the value, e.g. dBm. Most systems support UTF-8, allowing characters like the degree symbol.
|
pure virtual |
Get the value template.
The value template describes which JSON attribute corresponds to the sensor's measurement value.