looks like pythons match isn't recognized yet

This commit is contained in:
Gábor Poczkodi 2024-10-19 21:59:06 +02:00
parent d4493eb3f4
commit 579443593b
4 changed files with 11 additions and 7 deletions

View file

@ -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)

View file

@ -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

View file

@ -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:

View file

@ -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: