From b49e5b575a8a621e01a37303bae9cdbd5f1a239a Mon Sep 17 00:00:00 2001 From: jota29 Date: Wed, 15 Mar 2023 15:55:20 +0000 Subject: [PATCH] added '#ifdef USE_ARDUINO' for clang-tidy check with IDF framework --- esphome/components/optolink/optolink.cpp | 4 ++++ esphome/components/optolink/optolink.h | 4 ++++ esphome/components/optolink/optolink_binary_sensor.h | 4 ++++ esphome/components/optolink/optolink_device_info_sensor.cpp | 4 ++++ esphome/components/optolink/optolink_device_info_sensor.h | 4 ++++ esphome/components/optolink/optolink_number.cpp | 4 ++++ esphome/components/optolink/optolink_number.h | 4 ++++ esphome/components/optolink/optolink_select.cpp | 4 ++++ esphome/components/optolink/optolink_select.h | 4 ++++ esphome/components/optolink/optolink_sensor.h | 4 ++++ esphome/components/optolink/optolink_sensor_base.cpp | 4 ++++ esphome/components/optolink/optolink_sensor_base.h | 5 ++++- esphome/components/optolink/optolink_state_sensor.h | 4 ++++ esphome/components/optolink/optolink_switch.cpp | 4 ++++ esphome/components/optolink/optolink_switch.h | 4 ++++ esphome/components/optolink/optolink_text_sensor.cpp | 4 ++++ esphome/components/optolink/optolink_text_sensor.h | 4 ++++ 17 files changed, 68 insertions(+), 1 deletion(-) diff --git a/esphome/components/optolink/optolink.cpp b/esphome/components/optolink/optolink.cpp index b2081831ea..e5fe87d5d2 100644 --- a/esphome/components/optolink/optolink.cpp +++ b/esphome/components/optolink/optolink.cpp @@ -1,3 +1,5 @@ +#ifdef USE_ARDUINO + #include "esphome/core/defines.h" #include "optolink.h" #include "VitoWiFi.h" @@ -76,3 +78,5 @@ size_t Optolink::write(uint8_t ch) { } // namespace optolink } // namespace esphome + +#endif diff --git a/esphome/components/optolink/optolink.h b/esphome/components/optolink/optolink.h index fe4eb396cd..7389f60126 100644 --- a/esphome/components/optolink/optolink.h +++ b/esphome/components/optolink/optolink.h @@ -1,5 +1,7 @@ #pragma once +#ifdef USE_ARDUINO + #include "esphome/core/component.h" #include "esphome/components/sensor/sensor.h" #include "esphome/components/binary_sensor/binary_sensor.h" @@ -39,3 +41,5 @@ class Optolink : public esphome::Component, public Print { } // namespace optolink } // namespace esphome + +#endif diff --git a/esphome/components/optolink/optolink_binary_sensor.h b/esphome/components/optolink/optolink_binary_sensor.h index 1aa20b9208..a9446538db 100644 --- a/esphome/components/optolink/optolink_binary_sensor.h +++ b/esphome/components/optolink/optolink_binary_sensor.h @@ -1,5 +1,7 @@ #pragma once +#ifdef USE_ARDUINO + #include "esphome/components/binary_sensor/binary_sensor.h" #include "optolink.h" #include "optolink_sensor_base.h" @@ -26,3 +28,5 @@ class OptolinkBinarySensor : public OptolinkSensorBase, }; } // namespace optolink } // namespace esphome + +#endif diff --git a/esphome/components/optolink/optolink_device_info_sensor.cpp b/esphome/components/optolink/optolink_device_info_sensor.cpp index 5fad8ec52b..4ce4e19974 100644 --- a/esphome/components/optolink/optolink_device_info_sensor.cpp +++ b/esphome/components/optolink/optolink_device_info_sensor.cpp @@ -1,3 +1,5 @@ +#ifdef USE_ARDUINO + #include "esphome/core/log.h" #include "optolink_device_info_sensor.h" @@ -20,3 +22,5 @@ void OptolinkDeviceInfoSensor::setup() { } } // namespace optolink } // namespace esphome + +#endif diff --git a/esphome/components/optolink/optolink_device_info_sensor.h b/esphome/components/optolink/optolink_device_info_sensor.h index 3555cd4215..5c00267fea 100644 --- a/esphome/components/optolink/optolink_device_info_sensor.h +++ b/esphome/components/optolink/optolink_device_info_sensor.h @@ -1,5 +1,7 @@ #pragma once +#ifdef USE_ARDUINO + #include "esphome/components/text_sensor/text_sensor.h" #include "optolink.h" #include "optolink_sensor_base.h" @@ -28,3 +30,5 @@ class OptolinkDeviceInfoSensor : public esphome::text_sensor::TextSensor, public } // namespace optolink } // namespace esphome + +#endif diff --git a/esphome/components/optolink/optolink_number.cpp b/esphome/components/optolink/optolink_number.cpp index 5c071284f2..3039d219fb 100644 --- a/esphome/components/optolink/optolink_number.cpp +++ b/esphome/components/optolink/optolink_number.cpp @@ -1,3 +1,5 @@ +#ifdef USE_ARDUINO + #include "optolink_number.h" #include "optolink.h" #include "VitoWiFi.h" @@ -18,3 +20,5 @@ void OptolinkNumber::control(float value) { } // namespace optolink } // namespace esphome + +#endif diff --git a/esphome/components/optolink/optolink_number.h b/esphome/components/optolink/optolink_number.h index 5868eddccd..13ca89041d 100644 --- a/esphome/components/optolink/optolink_number.h +++ b/esphome/components/optolink/optolink_number.h @@ -1,5 +1,7 @@ #pragma once +#ifdef USE_ARDUINO + #include "esphome/components/number/number.h" #include "optolink_sensor_base.h" #include "optolink.h" @@ -24,3 +26,5 @@ class OptolinkNumber : public OptolinkSensorBase, public esphome::number::Number } // namespace optolink } // namespace esphome + +#endif diff --git a/esphome/components/optolink/optolink_select.cpp b/esphome/components/optolink/optolink_select.cpp index 3831984ae7..783c614bce 100644 --- a/esphome/components/optolink/optolink_select.cpp +++ b/esphome/components/optolink/optolink_select.cpp @@ -1,3 +1,5 @@ +#ifdef USE_ARDUINO + #include "optolink_select.h" #include "optolink.h" #include "VitoWiFi.h" @@ -39,3 +41,5 @@ void OptolinkSelect::value_changed(float state) { } // namespace optolink } // namespace esphome + +#endif diff --git a/esphome/components/optolink/optolink_select.h b/esphome/components/optolink/optolink_select.h index 454230fb0e..017239f65f 100644 --- a/esphome/components/optolink/optolink_select.h +++ b/esphome/components/optolink/optolink_select.h @@ -1,5 +1,7 @@ #pragma once +#ifdef USE_ARDUINO + #include #include "esphome/components/select/select.h" #include "optolink.h" @@ -37,3 +39,5 @@ class OptolinkSelect : public OptolinkSensorBase, public esphome::select::Select } // namespace optolink } // namespace esphome + +#endif diff --git a/esphome/components/optolink/optolink_sensor.h b/esphome/components/optolink/optolink_sensor.h index dd10697de2..f51fd715f9 100644 --- a/esphome/components/optolink/optolink_sensor.h +++ b/esphome/components/optolink/optolink_sensor.h @@ -1,5 +1,7 @@ #pragma once +#ifdef USE_ARDUINO + #include "esphome/components/sensor/sensor.h" #include "optolink.h" #include "optolink_sensor_base.h" @@ -23,3 +25,5 @@ class OptolinkSensor : public OptolinkSensorBase, public esphome::sensor::Sensor }; } // namespace optolink } // namespace esphome + +#endif diff --git a/esphome/components/optolink/optolink_sensor_base.cpp b/esphome/components/optolink/optolink_sensor_base.cpp index 26ea2ed000..abe2b48c4e 100644 --- a/esphome/components/optolink/optolink_sensor_base.cpp +++ b/esphome/components/optolink/optolink_sensor_base.cpp @@ -1,3 +1,5 @@ +#ifdef USE_ARDUINO + #include "optolink_sensor_base.h" #include "optolink.h" @@ -160,3 +162,5 @@ DPValue conv2_100_F::decode(const uint8_t *in) { } // namespace optolink } // namespace esphome + +#endif diff --git a/esphome/components/optolink/optolink_sensor_base.h b/esphome/components/optolink/optolink_sensor_base.h index acb6992d94..4ebaec463c 100644 --- a/esphome/components/optolink/optolink_sensor_base.h +++ b/esphome/components/optolink/optolink_sensor_base.h @@ -1,6 +1,7 @@ - #pragma once +#ifdef USE_ARDUINO + #include "esphome/core/log.h" #include "VitoWiFi.h" @@ -46,3 +47,5 @@ class conv2_100_F : public DPType { } // namespace optolink } // namespace esphome + +#endif diff --git a/esphome/components/optolink/optolink_state_sensor.h b/esphome/components/optolink/optolink_state_sensor.h index 324c320a5c..889a777d0a 100644 --- a/esphome/components/optolink/optolink_state_sensor.h +++ b/esphome/components/optolink/optolink_state_sensor.h @@ -1,5 +1,7 @@ #pragma once +#ifdef USE_ARDUINO + #include "esphome/components/text_sensor/text_sensor.h" #include "optolink.h" #include "optolink_sensor_base.h" @@ -26,3 +28,5 @@ class OptolinkStateSensor : public esphome::text_sensor::TextSensor, public esph }; } // namespace optolink } // namespace esphome + +#endif diff --git a/esphome/components/optolink/optolink_switch.cpp b/esphome/components/optolink/optolink_switch.cpp index 514ae5a677..066f11a1a4 100644 --- a/esphome/components/optolink/optolink_switch.cpp +++ b/esphome/components/optolink/optolink_switch.cpp @@ -1,3 +1,5 @@ +#ifdef USE_ARDUINO + #include "optolink_switch.h" #include "optolink.h" #include "VitoWiFi.h" @@ -18,3 +20,5 @@ void OptolinkSwitch::write_state(bool value) { } // namespace optolink } // namespace esphome + +#endif diff --git a/esphome/components/optolink/optolink_switch.h b/esphome/components/optolink/optolink_switch.h index 33378b59a0..0e4c3d8319 100644 --- a/esphome/components/optolink/optolink_switch.h +++ b/esphome/components/optolink/optolink_switch.h @@ -1,5 +1,7 @@ #pragma once +#ifdef USE_ARDUINO + #include "esphome/components/switch/switch.h" #include "optolink_sensor_base.h" #include "optolink.h" @@ -27,3 +29,5 @@ class OptolinkSwitch : public OptolinkSensorBase, public esphome::switch_::Switc } // namespace optolink } // namespace esphome + +#endif diff --git a/esphome/components/optolink/optolink_text_sensor.cpp b/esphome/components/optolink/optolink_text_sensor.cpp index 4f6f656aca..700e9578f7 100644 --- a/esphome/components/optolink/optolink_text_sensor.cpp +++ b/esphome/components/optolink/optolink_text_sensor.cpp @@ -1,3 +1,5 @@ +#ifdef USE_ARDUINO + #include "optolink_text_sensor.h" #include "optolink.h" #include "VitoWiFi.h" @@ -23,3 +25,5 @@ void OptolinkTextSensor::setup() { } // namespace optolink } // namespace esphome + +#endif diff --git a/esphome/components/optolink/optolink_text_sensor.h b/esphome/components/optolink/optolink_text_sensor.h index 56d7c0464a..5d51e200ac 100644 --- a/esphome/components/optolink/optolink_text_sensor.h +++ b/esphome/components/optolink/optolink_text_sensor.h @@ -1,5 +1,7 @@ #pragma once +#ifdef USE_ARDUINO + #include "esphome/components/text_sensor/text_sensor.h" #include "optolink.h" #include "optolink_sensor_base.h" @@ -29,3 +31,5 @@ class OptolinkTextSensor : public OptolinkSensorBase, } // namespace optolink } // namespace esphome + +#endif