diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..596558e --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,9 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.2.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-added-large-files diff --git a/base.yaml b/base.yaml index 7737526..86e1ef7 100644 --- a/base.yaml +++ b/base.yaml @@ -44,7 +44,7 @@ switch: - platform: gpio id: "${id_prefix}_status_door" internal: true - pin: + pin: number: ${status_door_pin} # D0 output door status, HIGH for open, LOW for closed mode: output: true @@ -53,7 +53,7 @@ switch: - platform: gpio id: "${id_prefix}_status_obstruction" internal: true - pin: + pin: number: ${status_obstruction_pin} # D8 output for obstruction status, HIGH for obstructed, LOW for clear mode: output: true @@ -82,7 +82,7 @@ binary_sensor: id: ${id_prefix}_button ratgdo_id: ${id_prefix} name: "Button" - entity_category: diagnostic + entity_category: diagnostic - platform: ratgdo type: motor id: ${id_prefix}_motor @@ -92,7 +92,7 @@ binary_sensor: entity_category: diagnostic - platform: gpio id: "${id_prefix}_dry_contact_open" - pin: + pin: number: ${dry_contact_open_pin} # D5 dry contact for opening door inverted: true mode: @@ -108,12 +108,12 @@ binary_sensor: - cover.open: ${id_prefix}_garage_door - platform: gpio id: "${id_prefix}_dry_contact_close" - pin: + pin: number: ${dry_contact_close_pin} # D6 dry contact for closing door inverted: true mode: input: true - pullup: true + pullup: true name: "Dry contact close" entity_category: diagnostic on_press: @@ -124,12 +124,12 @@ binary_sensor: - cover.close: ${id_prefix}_garage_door - platform: gpio id: "${id_prefix}_dry_contact_light" - pin: + pin: number: ${dry_contact_light_pin} # D3 dry contact for triggering light (no discrete light commands, so toggle only) inverted: true mode: input: true - pullup: true + pullup: true name: "Dry contact light" entity_category: diagnostic on_press: @@ -144,7 +144,7 @@ number: name: "Rolling code counter" mode: box unit_of_measurement: "codes" - + - platform: ratgdo id: ${id_prefix}_opening_duration type: opening_duration @@ -184,21 +184,21 @@ button: - platform: safe_mode name: "Safe mode boot" entity_category: diagnostic - + - platform: template id: ${id_prefix}_query_status entity_category: diagnostic name: "Query status" - on_press: + on_press: then: lambda: !lambda |- - id($id_prefix).query_status(); - + id($id_prefix).query_status(); + - platform: template id: ${id_prefix}_query_openings name: "Query openings" entity_category: diagnostic - on_press: + on_press: then: lambda: !lambda |- id($id_prefix).query_openings(); @@ -207,7 +207,7 @@ button: id: ${id_prefix}_sync name: "Sync" entity_category: diagnostic - on_press: + on_press: then: lambda: !lambda |- id($id_prefix).sync(); @@ -215,7 +215,7 @@ button: - platform: template id: ${id_prefix}_toggle_door name: "Toggle door" - on_press: + on_press: then: lambda: !lambda |- id($id_prefix).toggle_door(); diff --git a/components/ratgdo/__init__.py b/components/ratgdo/__init__.py index e2f0834..c871a68 100644 --- a/components/ratgdo/__init__.py +++ b/components/ratgdo/__init__.py @@ -77,7 +77,7 @@ async def to_code(config): pin = await cg.gpio_pin_expression(config[CONF_INPUT_OBST]) cg.add(var.set_input_obst_pin(pin)) cg.add(var.set_remote_id(config[CONF_REMOTE_ID])) - + for conf in config.get(CONF_ON_SYNC_FAILED, []): trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var) await automation.build_automation(trigger, [], conf) diff --git a/components/ratgdo/automation.h b/components/ratgdo/automation.h index 2c23603..c0cfb42 100644 --- a/components/ratgdo/automation.h +++ b/components/ratgdo/automation.h @@ -20,4 +20,4 @@ namespace ratgdo { }; } -} \ No newline at end of file +} diff --git a/components/ratgdo/ratgdo.h b/components/ratgdo/ratgdo.h index c2a614e..9a27136 100644 --- a/components/ratgdo/ratgdo.h +++ b/components/ratgdo/ratgdo.h @@ -211,4 +211,4 @@ namespace ratgdo { }; // RATGDOComponent } // namespace ratgdo -} // namespace esphome \ No newline at end of file +} // namespace esphome diff --git a/components/ratgdo/ratgdo_state.h b/components/ratgdo/ratgdo_state.h index 1397e95..e347279 100644 --- a/components/ratgdo/ratgdo_state.h +++ b/components/ratgdo/ratgdo_state.h @@ -65,4 +65,4 @@ namespace ratgdo { (UNKNOWN, 2)) } // namespace ratgdo -} // namespace esphome \ No newline at end of file +} // namespace esphome diff --git a/static/index.html b/static/index.html index e2c238e..0a31b98 100644 --- a/static/index.html +++ b/static/index.html @@ -167,11 +167,11 @@ + +

@@ -190,7 +190,7 @@ Please support his excellent work by buying his boards. Buy boards from Paul + >Buy boards from Paul