mirror of
https://github.com/esphome/esphome.git
synced 2024-11-22 11:47:30 +01:00
Lint
This commit is contained in:
parent
16c2929bb4
commit
12ff280d3b
@ -3,38 +3,26 @@
|
||||
|
||||
class CustomSensor : public Component, public Sensor {
|
||||
public:
|
||||
void loop() override {
|
||||
publish_state(42.0);
|
||||
}
|
||||
void loop() override { publish_state(42.0); }
|
||||
};
|
||||
|
||||
class CustomTextSensor : public Component, public TextSensor {
|
||||
public:
|
||||
void loop() override {
|
||||
publish_state("Hello World");
|
||||
}
|
||||
void loop() override { publish_state("Hello World"); }
|
||||
};
|
||||
|
||||
class CustomBinarySensor : public Component, public BinarySensor {
|
||||
public:
|
||||
void loop() override {
|
||||
publish_state(false);
|
||||
}
|
||||
void loop() override { publish_state(false); }
|
||||
};
|
||||
|
||||
class CustomSwitch : public Switch {
|
||||
protected:
|
||||
void write_state(bool state) override {
|
||||
ESP_LOGD("custom_switch", "Setting %s", ONOFF(state));
|
||||
}
|
||||
void write_state(bool state) override { ESP_LOGD("custom_switch", "Setting %s", ONOFF(state)); }
|
||||
};
|
||||
|
||||
class CustomComponent : public PollingComponent {
|
||||
public:
|
||||
void setup() override {
|
||||
ESP_LOGD("custom_component", "Setup");
|
||||
}
|
||||
void update() override {
|
||||
ESP_LOGD("custom_component", "Update");
|
||||
}
|
||||
void setup() override { ESP_LOGD("custom_component", "Setup"); }
|
||||
void update() override { ESP_LOGD("custom_component", "Update"); }
|
||||
};
|
||||
|
@ -11,7 +11,7 @@ void setup() {
|
||||
App.init_ota()->start_safe_mode();
|
||||
|
||||
// LEDC is only available on ESP32! for the ESP8266, take a look at App.make_esp8266_pwm_output().
|
||||
auto *red = App.make_ledc_output(32); // on pin 32
|
||||
auto *red = App.make_ledc_output(32); // on pin 32
|
||||
auto *green = App.make_ledc_output(33);
|
||||
auto *blue = App.make_ledc_output(34);
|
||||
App.make_rgb_light("Livingroom Light", red, green, blue);
|
||||
@ -23,6 +23,4 @@ void setup() {
|
||||
App.setup();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
App.loop();
|
||||
}
|
||||
void loop() { App.loop(); }
|
||||
|
@ -29,6 +29,4 @@ void setup() {
|
||||
App.setup();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
App.loop();
|
||||
}
|
||||
void loop() { App.loop(); }
|
||||
|
Loading…
Reference in New Issue
Block a user