void write_state(bool state) override
Base class for all switches.
bool state
The current reported state of the binary sensor.
void publish_state(bool state)
Publish a state to the front-end from the back-end.
Providing packet encoding functions for exchanging data with a remote host.
float random_float()
Return a random float between 0 and 1.