16 float base = std::isnan(this->
state) ? 0.0f : this->
state;
This class simplifies creating components that periodically check a state.
Base-class for all sensors.
void publish_state(float state)
Publish a new state to the front-end.
float state
This member variable stores the last state that has passed through all filters.
StateClass get_state_class()
Get the state class, using the manual override if set.
@ STATE_CLASS_TOTAL_INCREASING
Providing packet encoding functions for exchanging data with a remote host.
float random_float()
Return a random float between 0 and 1.