Class Mycila::HA::Sensor¶
ClassList > Mycila > HA > Sensor
#include <MycilaHADiscovery.h>
Inherits the following classes: Mycila::HA::Component
Inherited by the following classes: Mycila::HA::Counter, Mycila::HA::Enum, Mycila::HA::Gauge, Mycila::HA::Total, Mycila::HA::Value
Public Attributes¶
| Type | Name |
|---|---|
| std::optional< uint32_t > | expireAfter |
| StateClass | stateClass = StateClass::NONE |
| std::string | stateTopic |
| const char * | unit = nullptr |
| const char * | valueTemplate = nullptr |
Public Attributes inherited from Mycila::HA::Component¶
| Type | Name |
|---|---|
| const char * | availabilityTemplate = nullptr |
| std::string | availabilityTopic |
| Category | category |
| std::string | configTopic |
| std::string | defaultEntityId |
| const char * | deviceClass |
| std::optional< bool > | enabledByDefault |
| const char * | icon |
| std::string | id |
| std::string | name |
| const char * | payloadAvailable = nullptr |
| const char * | payloadNotAvailable = nullptr |
| const char * | type |
| std::string | uniqueId |
| bool | useDeviceAvailability = true |
Public Functions¶
| Type | Name |
|---|---|
| Sensor (std::string id) |
|
| Sensor (std::string id, std::string name, std::string stateTopic, const StateClass stateClass=StateClass::NONE, const char * deviceClass=nullptr, const char * icon=nullptr, const char * unit=nullptr, const Category category=Category::NONE) |
|
| virtual void | toJson (const JsonObject & root) override |
| virtual | ~Sensor () = default |
Public Functions inherited from Mycila::HA::Component¶
| Type | Name |
|---|---|
| Component (const char * type, std::string id, std::string name, const char * deviceClass=nullptr, const char * icon=nullptr, const Category category=Category::NONE) |
|
| Component (const char * type, std::string id) |
|
| virtual void | toJson (const JsonObject & root) |
| virtual | ~Component () = default |
Public Attributes Documentation¶
variable expireAfter¶
variable stateClass¶
variable stateTopic¶
variable unit¶
variable valueTemplate¶
Public Functions Documentation¶
function Sensor [1/2]¶
function Sensor [2/2]¶
inline Mycila::HA::Sensor::Sensor (
std::string id,
std::string name,
std::string stateTopic,
const StateClass stateClass=StateClass::NONE,
const char * deviceClass=nullptr,
const char * icon=nullptr,
const char * unit=nullptr,
const Category category=Category::NONE
)
function toJson¶
Implements Mycila::HA::Component::toJson
function ~Sensor¶
The documentation for this class was generated from the following file src/MycilaHADiscovery.h