......
This commit is contained in:
@@ -12,6 +12,8 @@ namespace showcase_component {
|
||||
|
||||
enum state{ Off, Auto, On };
|
||||
|
||||
static const char *TAG = "showcase_component.component";
|
||||
|
||||
class ShowcaseComponent : public i2c::I2CDevice, public Component {
|
||||
public:
|
||||
void setup() override;
|
||||
@@ -26,16 +28,16 @@ class ShowcaseComponent : public i2c::I2CDevice, public Component {
|
||||
void write_state(state s){
|
||||
switch(s) {
|
||||
On:
|
||||
ESP_LOGI(TAG, "Set to On", data);
|
||||
ESP_LOGI(TAG, "Set to On");
|
||||
this->set_level(this->b_upper_, this->b_lower_);
|
||||
break;
|
||||
Off:
|
||||
ESP_LOGI(TAG, "Set to Off", data);
|
||||
ESP_LOGI(TAG, "Set to Off");
|
||||
this->upper_->set_level(0.0);
|
||||
this->lower_->set_level(0.0);
|
||||
break;
|
||||
Auto:
|
||||
ESP_LOGI(TAG, "Set to Auto", data);
|
||||
ESP_LOGI(TAG, "Set to Auto");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user