From 5e0ac7022e94200f0315ee7664a250e6ad1621f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Poczkodi?= Date: Thu, 29 Feb 2024 22:41:05 +0100 Subject: [PATCH] code formatting --- esphome/components/cc1101/__init__.py | 11 ++++++++--- tests/components/cc1101/test.esp32-c3-idf.yaml | 2 +- tests/components/cc1101/test.esp32-c3.yaml | 2 +- tests/components/cc1101/test.esp32-idf.yaml | 2 +- tests/components/cc1101/test.esp32-s2-idf.yaml | 2 +- tests/components/cc1101/test.esp32-s2.yaml | 2 +- tests/components/cc1101/test.esp32.yaml | 2 +- tests/components/cc1101/test.esp8266.yaml | 1 + 8 files changed, 15 insertions(+), 9 deletions(-) diff --git a/esphome/components/cc1101/__init__.py b/esphome/components/cc1101/__init__.py index 1f40d4bb1d..7c7d27813c 100644 --- a/esphome/components/cc1101/__init__.py +++ b/esphome/components/cc1101/__init__.py @@ -1,9 +1,8 @@ import esphome.codegen as cg import esphome.config_validation as cv -from esphome import automation, pins +from esphome import pins from esphome.components import sensor from esphome.components import spi -from esphome.automation import maybe_simple_id from esphome.components import remote_base from esphome.const import ( CONF_ID, @@ -56,6 +55,7 @@ CONFIG_SCHEMA = ( .extend(spi.spi_device_schema(cs_pin_required=True)) ) + async def to_code(config): var = cg.new_Pvariable(config[CONF_ID]) await cg.register_component(var, config) @@ -73,6 +73,7 @@ async def to_code(config): lqi = await sensor.new_sensor(config[CONF_LQI]) cg.add(var.set_config_lqi_sensor(lqi)) + CC1101RawAction = ns.class_("CC1101RawAction", remote_base.RemoteTransmitterActionBase) CC1101_TRANSMIT_SCHEMA = ( @@ -86,10 +87,14 @@ CC1101_TRANSMIT_SCHEMA = ( .extend(remote_base.RC_SWITCH_TRANSMITTER) ) + @remote_base.register_action("cc1101", CC1101RawAction, CC1101_TRANSMIT_SCHEMA) async def cc1101_action(var, config, args): proto = await cg.templatable( - config[CONF_PROTOCOL], args, remote_base.RCSwitchBase, to_exp=remote_base.build_rc_switch_protocol + config[CONF_PROTOCOL], + args, + remote_base.RCSwitchBase, + to_exp=remote_base.build_rc_switch_protocol, ) cg.add(var.set_protocol(proto)) cg.add(var.set_code(await cg.templatable(config[CONF_CODE], args, cg.std_string))) diff --git a/tests/components/cc1101/test.esp32-c3-idf.yaml b/tests/components/cc1101/test.esp32-c3-idf.yaml index 4b7a29a96b..221da41500 100644 --- a/tests/components/cc1101/test.esp32-c3-idf.yaml +++ b/tests/components/cc1101/test.esp32-c3-idf.yaml @@ -61,4 +61,4 @@ button: one: [2, 1] inverted: true repeat: - times: 10 \ No newline at end of file + times: 10 diff --git a/tests/components/cc1101/test.esp32-c3.yaml b/tests/components/cc1101/test.esp32-c3.yaml index 4b7a29a96b..221da41500 100644 --- a/tests/components/cc1101/test.esp32-c3.yaml +++ b/tests/components/cc1101/test.esp32-c3.yaml @@ -61,4 +61,4 @@ button: one: [2, 1] inverted: true repeat: - times: 10 \ No newline at end of file + times: 10 diff --git a/tests/components/cc1101/test.esp32-idf.yaml b/tests/components/cc1101/test.esp32-idf.yaml index bd7084a4c7..e65990ca00 100644 --- a/tests/components/cc1101/test.esp32-idf.yaml +++ b/tests/components/cc1101/test.esp32-idf.yaml @@ -52,4 +52,4 @@ button: one: [2, 1] inverted: true repeat: - times: 10 \ No newline at end of file + times: 10 diff --git a/tests/components/cc1101/test.esp32-s2-idf.yaml b/tests/components/cc1101/test.esp32-s2-idf.yaml index 24e27c3c6d..d797e7ba25 100644 --- a/tests/components/cc1101/test.esp32-s2-idf.yaml +++ b/tests/components/cc1101/test.esp32-s2-idf.yaml @@ -52,4 +52,4 @@ button: one: [2, 1] inverted: true repeat: - times: 10 \ No newline at end of file + times: 10 diff --git a/tests/components/cc1101/test.esp32-s2.yaml b/tests/components/cc1101/test.esp32-s2.yaml index 24e27c3c6d..d797e7ba25 100644 --- a/tests/components/cc1101/test.esp32-s2.yaml +++ b/tests/components/cc1101/test.esp32-s2.yaml @@ -52,4 +52,4 @@ button: one: [2, 1] inverted: true repeat: - times: 10 \ No newline at end of file + times: 10 diff --git a/tests/components/cc1101/test.esp32.yaml b/tests/components/cc1101/test.esp32.yaml index bd7084a4c7..e65990ca00 100644 --- a/tests/components/cc1101/test.esp32.yaml +++ b/tests/components/cc1101/test.esp32.yaml @@ -52,4 +52,4 @@ button: one: [2, 1] inverted: true repeat: - times: 10 \ No newline at end of file + times: 10 diff --git a/tests/components/cc1101/test.esp8266.yaml b/tests/components/cc1101/test.esp8266.yaml index 632dc26c8d..4361baa7ac 100644 --- a/tests/components/cc1101/test.esp8266.yaml +++ b/tests/components/cc1101/test.esp8266.yaml @@ -60,3 +60,4 @@ button: inverted: true repeat: times: 10 +