mirror of
https://github.com/esphome/esphome.git
synced 2024-11-23 23:48:11 +01:00
looks like pythons match isn't recognized yet
This commit is contained in:
parent
d4493eb3f4
commit
579443593b
4 changed files with 11 additions and 7 deletions
|
@ -472,9 +472,8 @@ async def to_code(config):
|
||||||
|
|
||||||
async def new_sensor(c, args, setter):
|
async def new_sensor(c, args, setter):
|
||||||
s = None
|
s = None
|
||||||
match args[1]:
|
if args[1] == "binary_sensor":
|
||||||
case "binary_sensor":
|
s = await binary_sensor.new_binary_sensor(c)
|
||||||
s = await binary_sensor.new_binary_sensor(c)
|
|
||||||
cg.add(getattr(var, setter + "_" + args[1])(s))
|
cg.add(getattr(var, setter + "_" + args[1])(s))
|
||||||
|
|
||||||
await for_each_conf(config, SENSORS, new_sensor)
|
await for_each_conf(config, SENSORS, new_sensor)
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
namespace esphome {
|
||||||
|
namespace kt0803 {
|
||||||
|
|
||||||
#ifndef SUB_TEXT
|
#ifndef SUB_TEXT
|
||||||
#define SUB_TEXT(name) \
|
#define SUB_TEXT(name) \
|
||||||
protected: \
|
protected: \
|
||||||
|
@ -50,3 +53,5 @@
|
||||||
void publish_##name##_text_sensor() { this->publish(this->name##_text_sensor_, this->get_##name##_text_sensor()); } \
|
void publish_##name##_text_sensor() { this->publish(this->name##_text_sensor_, this->get_##name##_text_sensor()); } \
|
||||||
std::string get_##name##_text_sensor();
|
std::string get_##name##_text_sensor();
|
||||||
|
|
||||||
|
} // namespace kt0803
|
||||||
|
} // namespace esphome
|
||||||
|
|
|
@ -24,7 +24,7 @@ kt0803:
|
||||||
au_enhance: False
|
au_enhance: False
|
||||||
ref_clk:
|
ref_clk:
|
||||||
enable: False
|
enable: False
|
||||||
ref_clk: '32.768kHz'
|
sel: '32.768kHz'
|
||||||
xtal:
|
xtal:
|
||||||
enable: True
|
enable: True
|
||||||
sel: '32.768kHz'
|
sel: '32.768kHz'
|
||||||
|
@ -109,7 +109,7 @@ select:
|
||||||
sel:
|
sel:
|
||||||
name: Xtal Selection
|
name: Xtal Selection
|
||||||
ref_clk:
|
ref_clk:
|
||||||
ref_clk:
|
sel:
|
||||||
name: Refence Clock
|
name: Refence Clock
|
||||||
alc:
|
alc:
|
||||||
attack_time:
|
attack_time:
|
||||||
|
|
|
@ -24,7 +24,7 @@ kt0803:
|
||||||
au_enhance: False
|
au_enhance: False
|
||||||
ref_clk:
|
ref_clk:
|
||||||
enable: False
|
enable: False
|
||||||
ref_clk: '32.768kHz'
|
sel: '32.768kHz'
|
||||||
xtal:
|
xtal:
|
||||||
enable: True
|
enable: True
|
||||||
sel: '32.768kHz'
|
sel: '32.768kHz'
|
||||||
|
@ -109,7 +109,7 @@ select:
|
||||||
sel:
|
sel:
|
||||||
name: Xtal Selection
|
name: Xtal Selection
|
||||||
ref_clk:
|
ref_clk:
|
||||||
ref_clk:
|
sel:
|
||||||
name: Refence Clock
|
name: Refence Clock
|
||||||
alc:
|
alc:
|
||||||
attack_time:
|
attack_time:
|
||||||
|
|
Loading…
Reference in a new issue