1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-23 20:23:50 +01:00

Activate some clang-tidy checks (#1884)

This commit is contained in:
Otto Winter
2021-06-10 13:04:40 +02:00
committed by GitHub
parent eb9bd69405
commit 360effcb72
109 changed files with 458 additions and 422 deletions

View File

@@ -88,7 +88,7 @@ class WebServer : public Controller, public Component, public AsyncWebHandler {
#ifdef USE_SENSOR
void on_sensor_update(sensor::Sensor *obj, float state) override;
/// Handle a sensor request under '/sensor/<id>'.
void handle_sensor_request(AsyncWebServerRequest *request, UrlMatch match);
void handle_sensor_request(AsyncWebServerRequest *request, const UrlMatch &match);
/// Dump the sensor state with its value as a JSON string.
std::string sensor_json(sensor::Sensor *obj, float value);
@@ -98,7 +98,7 @@ class WebServer : public Controller, public Component, public AsyncWebHandler {
void on_switch_update(switch_::Switch *obj, bool state) override;
/// Handle a switch request under '/switch/<id>/</turn_on/turn_off/toggle>'.
void handle_switch_request(AsyncWebServerRequest *request, UrlMatch match);
void handle_switch_request(AsyncWebServerRequest *request, const UrlMatch &match);
/// Dump the switch state with its value as a JSON string.
std::string switch_json(switch_::Switch *obj, bool value);
@@ -108,7 +108,7 @@ class WebServer : public Controller, public Component, public AsyncWebHandler {
void on_binary_sensor_update(binary_sensor::BinarySensor *obj, bool state) override;
/// Handle a binary sensor request under '/binary_sensor/<id>'.
void handle_binary_sensor_request(AsyncWebServerRequest *request, UrlMatch match);
void handle_binary_sensor_request(AsyncWebServerRequest *request, const UrlMatch &match);
/// Dump the binary sensor state with its value as a JSON string.
std::string binary_sensor_json(binary_sensor::BinarySensor *obj, bool value);
@@ -118,7 +118,7 @@ class WebServer : public Controller, public Component, public AsyncWebHandler {
void on_fan_update(fan::FanState *obj) override;
/// Handle a fan request under '/fan/<id>/</turn_on/turn_off/toggle>'.
void handle_fan_request(AsyncWebServerRequest *request, UrlMatch match);
void handle_fan_request(AsyncWebServerRequest *request, const UrlMatch &match);
/// Dump the fan state as a JSON string.
std::string fan_json(fan::FanState *obj);
@@ -128,17 +128,17 @@ class WebServer : public Controller, public Component, public AsyncWebHandler {
void on_light_update(light::LightState *obj) override;
/// Handle a light request under '/light/<id>/</turn_on/turn_off/toggle>'.
void handle_light_request(AsyncWebServerRequest *request, UrlMatch match);
void handle_light_request(AsyncWebServerRequest *request, const UrlMatch &match);
/// Dump the light state as a JSON string.
std::string light_json(light::LightState *obj);
#endif
#ifdef USE_TEXT_SENSOR
void on_text_sensor_update(text_sensor::TextSensor *obj, std::string state) override;
void on_text_sensor_update(text_sensor::TextSensor *obj, const std::string &state) override;
/// Handle a text sensor request under '/text_sensor/<id>'.
void handle_text_sensor_request(AsyncWebServerRequest *request, UrlMatch match);
void handle_text_sensor_request(AsyncWebServerRequest *request, const UrlMatch &match);
/// Dump the text sensor state with its value as a JSON string.
std::string text_sensor_json(text_sensor::TextSensor *obj, const std::string &value);
@@ -148,7 +148,7 @@ class WebServer : public Controller, public Component, public AsyncWebHandler {
void on_cover_update(cover::Cover *obj) override;
/// Handle a cover request under '/cover/<id>/<open/close/stop/set>'.
void handle_cover_request(AsyncWebServerRequest *request, UrlMatch match);
void handle_cover_request(AsyncWebServerRequest *request, const UrlMatch &match);
/// Dump the cover state as a JSON string.
std::string cover_json(cover::Cover *obj);