CodeRabbitAI suggestions

This commit is contained in:
Edward Firmo
2024-12-19 23:39:32 +01:00
parent 81bf402e35
commit e9890c937e
7 changed files with 222 additions and 155 deletions

View File

@@ -11,6 +11,9 @@
##### - For normal system use, modifications to this file are NOT required. #####
####################################################################################################
---
substitutions:
vibration_max_duration: 5s
binary_sensor:
- id: bs_vibrating
name: Vibrating
@@ -45,6 +48,11 @@ number:
optimistic: true
restore_value: true
ota:
on_state_change:
then:
- switch.turn_off: sw_vibration_motor
script:
- id: !extend touch_on_multi_touch_release
then:
@@ -112,9 +120,19 @@ switch:
internal: true
on_turn_on:
then:
- lambda: bs_vibrating->publish_state(true);
- binary_sensor.template.publish:
id: bs_vibrating
state: ON # yamllint disable-line rule:truthy
- delay: ${vibration_max_duration}
- if:
condition:
switch.is_on: sw_vibration_motor
then:
- switch.turn_off: sw_vibration_motor
on_turn_off:
then:
- lambda: bs_vibrating->publish_state(false);
- binary_sensor.template.publish:
id: bs_vibrating
state: OFF # yamllint disable-line rule:truthy
...