chore: add .pre-commit-config.yaml for end of line fixer (#66)

This commit is contained in:
J. Nick Koston 2023-10-18 14:23:30 -10:00 committed by GitHub
parent 6d8f3e0e86
commit f323e02df1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 32 additions and 23 deletions

9
.pre-commit-config.yaml Normal file
View File

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

View File

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

View File

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

View File

@ -20,4 +20,4 @@ namespace ratgdo {
};
}
}
}

View File

@ -211,4 +211,4 @@ namespace ratgdo {
}; // RATGDOComponent
} // namespace ratgdo
} // namespace esphome
} // namespace esphome

View File

@ -65,4 +65,4 @@ namespace ratgdo {
(UNKNOWN, 2))
} // namespace ratgdo
} // namespace esphome
} // namespace esphome

View File

@ -167,11 +167,11 @@
<label>
<input type="radio" name="type" value="v2board_esp32_d1_mini" />
<img src="./v2board_esp32_d1_mini.png" alt="ratgdo v2 board with ESP32 D1 Mini" />
</label>
</label>
<label>
<input type="radio" name="type" value="v2board_esp32_lolin_s2_mini" />
<img src="./v2board_esp32_lolin_s2_mini.png" alt="ratgdo v2 board with ESP32 lolin s2 mini" />
</label>
</label>
</div>
<p class="button-row" align="center">
@ -190,7 +190,7 @@
Please support his excellent work by buying his boards.
<a
href="https://paulwieland.github.io/ratgdo/#order"
>Buy boards from Paul</a>
>Buy boards from Paul</a>
</p>
</div>