Document Speaker volume set action (#4343)

This commit is contained in:
Kevin Ahrendt 2024-10-16 18:47:14 -04:00 committed by GitHub
parent 5bf9939729
commit ddfff8d4d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 26 additions and 1 deletions

View File

@ -57,7 +57,7 @@
- **senseair:** ``abc_disable``, ``abc_enable``, ``abc_get_period``, ``background_calibration``, ``background_calibration_result``
- **servo:** ``detach``, ``write``
- **sim800l:** ``connect``, ``dial``, ``disconnect``, ``send_sms``, ``send_ussd``
- **speaker:** ``play``, ``stop``
- **speaker:** ``play``, ``stop``, ``finish``, ``volume_set``
- **sprinkler:** ``clear_queued_valves``, ``next_valve``, ``pause``, ``previous_valve``, ``queue_valve``, ``resume``, ``resume_or_start_full_cycle``, ``set_divider``, ``set_multiplier``, ``set_repeat``, ``set_valve_run_duration``, ``shutdown``, ``start_from_queue``, ``start_full_cycle``, ``start_single_valve``
- **sps30:** ``start_fan_autoclean``
- **stepper:** ``report_position``, ``set_acceleration``, ``set_deceleration``, ``set_speed``, ``set_target``

View File

@ -71,6 +71,31 @@ Configuration variables:
- **id** (*Optional*, :ref:`config-id`): The speaker to control. Defaults to the only one in YAML.
.. _speaker-volume_set:
``speaker.volume_set`` Action
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This action will set the volume of the speaker.
.. code-block::
on_...:
# Simple
- speaker.volume_set: 50%
# Full
- speaker.volume_set:
id: speaker_id
volume: 50%
# Simple with lambda
- speaker.volume_set: !lambda "return 0.5;"
Configuration variables:
**volume** (**Required**, percentage): The volume to set the speaker to.
.. _speaker-conditions:
Speaker Conditions