From 3190855d50d7bcb65c0031f6080de9e28eb1530d Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Thu, 21 Nov 2024 17:35:02 +1300 Subject: [PATCH] Add volume control --- Integrations/ESPHome/Core.yaml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 9f5162d..673e8d9 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -10,8 +10,11 @@ output: - platform: ledc pin: GPIO10 id: buzzer + max_power: 60% + rtttl: - output: buzzer + id: rtttl_buzzer + output: buzzer globals: - id: cycleCounter @@ -109,6 +112,18 @@ number: - lambda: |- id(deep_sleep_1).set_sleep_duration(x * 60 * 60 * 1000); + - platform: template + name: Volume + min_value: 0 + max_value: 100 + initial_value: 100 + unit_of_measurement: "%" + step: 1 + optimistic: true + restore_value: true + on_value: + - lambda: id(rtttl_buzzer).set_gain(pow(x / 100.0f, 3)); + text: - platform: template name: "Song Single Click"