1#ifndef SENSESP_SENSORS_SYSTEM_INFO_H_
2#define SENSESP_SENSORS_SYSTEM_INFO_H_
5#include <elapsedMillis.h>
19 const String& prefix,
const String& name) {
21 String hostname = hostname_obs->get();
22 String path = prefix + hostname +
"." + name;
24 auto sk_output = std::make_shared<SKOutput<T>>(path);
28 auto update_output_sk_path = [hostname_obs, sk_output, prefix, name]() {
29 String path = prefix + hostname_obs->get() +
"." + name;
30 sk_output->set_sk_path(path);
32 update_output_sk_path();
34 hostname_obs->attach(update_output_sk_path);
37 sensor->connect_to(sk_output);
Reports the current amount of unused memory of the ESP.
reactesp::RepeatEvent * repeat_event_
Reports the IP address of the ESP once it's connected to wifi.
reactesp::RepeatEvent * repeat_event_
static const std::shared_ptr< SensESPBaseApp > & get()
Get the singleton instance of the SensESPBaseApp.
Reports the current clock speed of the ESP.
uint32_t last_tick_count_
elapsedMillis elapsed_millis_
reactesp::RepeatEvent * repeat_event_
Reports the number of seconds since the last restart of the ESP.
reactesp::RepeatEvent * repeat_event_
A base class for any sensor or piece of code that outputs a value for consumption elsewhere.
Reports the current strength of the wifi signal that the ESP is connected to.
reactesp::RepeatEvent * repeat_event_
std::shared_ptr< reactesp::EventLoop > event_loop()
void connect_system_info_sensor(std::shared_ptr< ValueProducer< T > > &sensor, const String &prefix, const String &name)
Connect a system information sensor to SKOutput.