|
|
|
@ -1,5 +1,6 @@
|
|
|
|
#pragma once
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "esphome/core/log.h"
|
|
|
|
#include "esphome/core/component.h"
|
|
|
|
#include "esphome/core/component.h"
|
|
|
|
#include "esphome/components/i2c/i2c.h"
|
|
|
|
#include "esphome/components/i2c/i2c.h"
|
|
|
|
#include "esphome/components/output/float_output.h"
|
|
|
|
#include "esphome/components/output/float_output.h"
|
|
|
|
@ -25,13 +26,16 @@ class ShowcaseComponent : public i2c::I2CDevice, public Component {
|
|
|
|
void write_state(state s){
|
|
|
|
void write_state(state s){
|
|
|
|
switch(s) {
|
|
|
|
switch(s) {
|
|
|
|
On:
|
|
|
|
On:
|
|
|
|
|
|
|
|
ESP_LOGI(TAG, "Set to On", data);
|
|
|
|
this->set_level(this->b_upper_, this->b_lower_);
|
|
|
|
this->set_level(this->b_upper_, this->b_lower_);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
Off:
|
|
|
|
Off:
|
|
|
|
|
|
|
|
ESP_LOGI(TAG, "Set to Off", data);
|
|
|
|
this->upper_->set_level(0.0);
|
|
|
|
this->upper_->set_level(0.0);
|
|
|
|
this->lower_->set_level(0.0);
|
|
|
|
this->lower_->set_level(0.0);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
Auto:
|
|
|
|
Auto:
|
|
|
|
|
|
|
|
ESP_LOGI(TAG, "Set to Auto", data);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|