Add MAX17043 battery sensor support and related components
This commit is contained in:
20
esphome/ha-remote/components/max17043/automation.h
Normal file
20
esphome/ha-remote/components/max17043/automation.h
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
#pragma once
|
||||
#include "esphome/core/automation.h"
|
||||
#include "max17043.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace max17043 {
|
||||
|
||||
template<typename... Ts> class SleepAction : public Action<Ts...> {
|
||||
public:
|
||||
explicit SleepAction(MAX17043Component *max17043) : max17043_(max17043) {}
|
||||
|
||||
void play(Ts... x) override { this->max17043_->sleep_mode(); }
|
||||
|
||||
protected:
|
||||
MAX17043Component *max17043_;
|
||||
};
|
||||
|
||||
} // namespace max17043
|
||||
} // namespace esphome
|
||||
Reference in New Issue
Block a user