Max6956 support added (#3764)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
looping40
2023-05-01 23:51:48 +02:00
committed by GitHub
parent bd6d6caa8a
commit de10b356cf
9 changed files with 549 additions and 0 deletions
@@ -0,0 +1,26 @@
#include "max6956_led_output.h"
#include "esphome/core/helpers.h"
#include "esphome/core/log.h"
namespace esphome {
namespace max6956 {
static const char *const TAG = "max6956_led_channel";
void MAX6956LedChannel::write_state(float state) { this->parent_->set_pin_brightness(this->pin_, state); }
void MAX6956LedChannel::write_state(bool state) { this->parent_->digital_write(this->pin_, state); }
void MAX6956LedChannel::setup() {
this->parent_->pin_mode(this->pin_, max6956::FLAG_LED);
this->turn_off();
}
void MAX6956LedChannel::dump_config() {
ESP_LOGCONFIG(TAG, "MAX6956 current:");
ESP_LOGCONFIG(TAG, " MAX6956 pin: %d", this->pin_);
LOG_FLOAT_OUTPUT(this);
}
} // namespace max6956
} // namespace esphome