19#ifndef SRC_SUPLA_SENSOR_THERM_HYGRO_METER_H_
20#define SRC_SUPLA_SENSOR_THERM_HYGRO_METER_H_
22#include <supla/channel_element.h>
23#include <supla/sensor/thermometer_driver.h>
25#define HUMIDITY_NOT_AVAILABLE -1
29class ThermHygroMeter :
public ChannelElement {
33 void setRefreshIntervalMs(
int intervalMs);
38 void fillChannelConfig(
void *channelConfig,
int *size)
override;
41 virtual double getTemp();
42 virtual double getHumi();
44 int16_t getTempInt16();
45 int16_t getHumiInt16();
49 int16_t getConfiguredTemperatureCorrection();
50 int16_t getConfiguredHumidityCorrection();
61 int32_t humidityCorrection,
98 int16_t readCorrectionFromIndex(
int index);
99 void setCorrectionAtIndex(int32_t correction,
int index);
100 virtual void setTemperatureCorrection(int32_t correction);
101 virtual void setHumidityCorrection(int32_t correction);
103 uint32_t lastReadTime = 0;
104 uint16_t refreshIntervalMs = 10000;
Definition SuplaDevice.h:93
void onLoadConfig(SuplaDeviceClass *) override
First method called on element in SuplaDevice.begin().
Definition therm_hygro_meter.cpp:87
void iterateAlways() override
Method called on each SuplaDevice iteration.
Definition therm_hygro_meter.cpp:80
bool applyCorrections
Whether correction should be applied by SD.
Definition therm_hygro_meter.h:121
void applyCorrectionsAndStoreIt(int32_t temperatureCorrection, int32_t humidityCorrection, bool local=false)
Apply temperature and humidity corrections and store them to Config.
Definition therm_hygro_meter.cpp:252
void setApplyCorrections(bool applyCorrections)
Set whether correction should be applied or not.
Definition therm_hygro_meter.cpp:300
int16_t minMaxAllowedTemperatureAdjustment
Minimum and maximum allowed temperature adjustment in 0.1 degree C.
Definition therm_hygro_meter.h:110
void setMinMaxAllowedHumidityAdjustment(int32_t minMax)
Set minimum and maximum allowed humidity adjustment.
Definition therm_hygro_meter.cpp:316
void setMinMaxAllowedTemperatureAdjustment(int32_t minMax)
Set minimum and maximum allowed temperature adjustment.
Definition therm_hygro_meter.cpp:305
int16_t minMaxAllowedHumidityAdjustment
Minimum and maximum allowed humidity adjustment in 0.1 RH.
Definition therm_hygro_meter.h:116
void onInit() override
Third method called on element in SuplaDevice.begin()
Definition therm_hygro_meter.cpp:32
void purgeConfig() override
Removes all configration data related to the element from Storage::Config.
Definition therm_hygro_meter.cpp:119