From 579443593bccb62b0ad47a023ee33ba87b1c37f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Poczkodi?= Date: Sat, 19 Oct 2024 21:59:06 +0200 Subject: [PATCH] looks like pythons match isn't recognized yet --- esphome/components/kt0803/__init__.py | 5 ++--- esphome/components/kt0803/kt0803sub.h | 5 +++++ tests/components/kt0803/test.esp32-s3-ard.yaml | 4 ++-- tests/components/kt0803/test.esp32-s3-idf.yaml | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/esphome/components/kt0803/__init__.py b/esphome/components/kt0803/__init__.py index ee1b629e76..01ca212b55 100644 --- a/esphome/components/kt0803/__init__.py +++ b/esphome/components/kt0803/__init__.py @@ -472,9 +472,8 @@ async def to_code(config): async def new_sensor(c, args, setter): s = None - match args[1]: - case "binary_sensor": - s = await binary_sensor.new_binary_sensor(c) + if args[1] == "binary_sensor": + s = await binary_sensor.new_binary_sensor(c) cg.add(getattr(var, setter + "_" + args[1])(s)) await for_each_conf(config, SENSORS, new_sensor) diff --git a/esphome/components/kt0803/kt0803sub.h b/esphome/components/kt0803/kt0803sub.h index 767ab8f43d..d19765bcae 100644 --- a/esphome/components/kt0803/kt0803sub.h +++ b/esphome/components/kt0803/kt0803sub.h @@ -1,5 +1,8 @@ #pragma once +namespace esphome { +namespace kt0803 { + #ifndef SUB_TEXT #define SUB_TEXT(name) \ protected: \ @@ -50,3 +53,5 @@ void publish_##name##_text_sensor() { this->publish(this->name##_text_sensor_, this->get_##name##_text_sensor()); } \ std::string get_##name##_text_sensor(); +} // namespace kt0803 +} // namespace esphome diff --git a/tests/components/kt0803/test.esp32-s3-ard.yaml b/tests/components/kt0803/test.esp32-s3-ard.yaml index f3668e30d8..6c071c60ff 100644 --- a/tests/components/kt0803/test.esp32-s3-ard.yaml +++ b/tests/components/kt0803/test.esp32-s3-ard.yaml @@ -24,7 +24,7 @@ kt0803: au_enhance: False ref_clk: enable: False - ref_clk: '32.768kHz' + sel: '32.768kHz' xtal: enable: True sel: '32.768kHz' @@ -109,7 +109,7 @@ select: sel: name: Xtal Selection ref_clk: - ref_clk: + sel: name: Refence Clock alc: attack_time: diff --git a/tests/components/kt0803/test.esp32-s3-idf.yaml b/tests/components/kt0803/test.esp32-s3-idf.yaml index f3668e30d8..6c071c60ff 100644 --- a/tests/components/kt0803/test.esp32-s3-idf.yaml +++ b/tests/components/kt0803/test.esp32-s3-idf.yaml @@ -24,7 +24,7 @@ kt0803: au_enhance: False ref_clk: enable: False - ref_clk: '32.768kHz' + sel: '32.768kHz' xtal: enable: True sel: '32.768kHz' @@ -109,7 +109,7 @@ select: sel: name: Xtal Selection ref_clk: - ref_clk: + sel: name: Refence Clock alc: attack_time: