1
0
mirror of https://github.com/esphome/esphome.git synced 2025-04-05 02:10:27 +01:00
Florian Trück 6b7b076875
SCD30 Added support for manual calibration (#4362)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2023-02-03 21:13:27 +13:00

24 lines
537 B
C++

#pragma once
#include "esphome/core/component.h"
#include "esphome/core/automation.h"
#include "scd30.h"
namespace esphome {
namespace scd30 {
template<typename... Ts> class ForceRecalibrationWithReference : public Action<Ts...>, public Parented<SCD30Component> {
public:
void play(Ts... x) override {
if (this->value_.has_value()) {
this->parent_->force_recalibration_with_reference(this->value_.value(x...));
}
}
protected:
TEMPLATABLE_VALUE(uint16_t, value)
};
} // namespace scd30
} // namespace esphome