esphome/esphome/components/sps30/automation.h
Martin 6fe22a7e62
SPS30: Add fan action (#3410)
* Add fan action to SPS30

* add codeowner
2022-04-26 09:50:36 +12:00

21 lines
454 B
C++

#pragma once
#include "esphome/core/component.h"
#include "esphome/core/automation.h"
#include "sps30.h"
namespace esphome {
namespace sps30 {
template<typename... Ts> class StartFanAction : public Action<Ts...> {
public:
explicit StartFanAction(SPS30Component *sps30) : sps30_(sps30) {}
void play(Ts... x) override { this->sps30_->start_fan_cleaning(); }
protected:
SPS30Component *sps30_;
};
} // namespace sps30
} // namespace esphome