.....
This commit is contained in:
@@ -17,13 +17,13 @@ void ShowcaseComponent::loop() {
|
|||||||
if(data != 0){
|
if(data != 0){
|
||||||
if(data & 1){
|
if(data & 1){
|
||||||
this->write_state(Off);
|
this->write_state(Off);
|
||||||
ESP_LOGI(TAG, "Set to Off", data);
|
/* ESP_LOGI(TAG, "Set to Off", data); */
|
||||||
} else if ( data & 2 ){
|
} else if ( data & 2 ){
|
||||||
this->write_state(Auto);
|
this->write_state(Auto);
|
||||||
ESP_LOGI(TAG, "Set to Auto", data);
|
/* ESP_LOGI(TAG, "Set to Auto", data); */
|
||||||
} else if ( data & 4 ){
|
} else if ( data & 4 ){
|
||||||
this->write_state(On);
|
this->write_state(On);
|
||||||
ESP_LOGI(TAG, "Set to On", data);
|
/* ESP_LOGI(TAG, "Set to On", data); */
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this->s_ == Auto) {
|
if(this->s_ == Auto) {
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user