supla-device
Loading...
Searching...
No Matches
esp_free_heap.h
1// SPDX-FileCopyrightText: AC SOFTWARE SP. Z O.O.
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4// DEPRECATED: please use channel based on GPM instead (gpm_esp_free_heap.h)
5
6#ifndef SRC_SUPLA_SENSOR_ESP_FREE_HEAP_H_
7#define SRC_SUPLA_SENSOR_ESP_FREE_HEAP_H_
8
9#include "supla/sensor/thermometer.h"
10
11namespace Supla {
12namespace Sensor {
13class EspFreeHeap : public Thermometer {
14 public:
15 void onInit() {
16 channel.setNewValue(getValue());
17 }
18
19 double getValue() {
20 return ESP.getFreeHeap() / 1024.0;
21 }
22
23 protected:
24};
25
26}; // namespace Sensor
27}; // namespace Supla
28
29#endif // SRC_SUPLA_SENSOR_ESP_FREE_HEAP_H_
Definition esp_free_heap.h:13
void onInit()
Third method called on element in SuplaDevice.begin()
Definition esp_free_heap.h:15
Definition thermometer.h:13