From 04e247ec9ab14a323c8cdf88a4becdcb146d1e97 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Mon, 13 Jun 2022 13:29:35 +1200 Subject: [PATCH 1/4] Add volume actions for media player (#2124) --- components/media_player/index.rst | 57 ++++++++++++++++++++++++++++--- guides/automations.rst | 1 + 2 files changed, 54 insertions(+), 4 deletions(-) diff --git a/components/media_player/index.rst b/components/media_player/index.rst index 48fc9d368..fa7a241ad 100644 --- a/components/media_player/index.rst +++ b/components/media_player/index.rst @@ -38,10 +38,21 @@ Configuration variables: See https://developers.home-assistant.io/docs/core/entity/#generic-properties for a list of available options. Set to ``""`` to remove the default entity category. +Media Player Actions +-------------------- + +All ``media_player`` actions can be used without specifying an ``id`` if you have only one ``media_player`` in +your configuration YAML. + +Configuration variables: + +**id** (*Optional*, :ref:`config-id`): The media player to control. Defaults to the only one in YAML. + + .. _media_player-play: ``media_player.play`` Action ----------------------------- +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This action will resume playing the media player. A future change will allow specifying the ``media_url`` for starting @@ -50,24 +61,62 @@ a new stream. .. _media_player-pause: ``media_player.pause`` Action ------------------------------ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This action pauses the current playback. .. _media_player-stop: ``media_player.stop`` Action ----------------------------- +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This action stops the current playback. .. _media_player-toggle: ``media_player.toggle`` Action ------------------------------- +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This action will pause or resume the current playback. +.. _media_player-volume_up: + +``media_player.volume_up`` Action +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This action will increase the volume of the media player. + +.. _media_player-volume_down: + +``media_player.volume_down`` Action +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This action will decrease the volume of the media player. + +.. _media_player-volume_set: + +``media_player.volume_set`` Action +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This action will set the volume of the media player. + +.. code-block:: + + on_...: + # Simple + - media_player.volume_set: 50% + + # Full + - media_player.volume_set: + id: media_player_id + volume: 50% + + # Simple with lambda + - media_player.volume_set: !lambda "return 0.5;" + +Configuration variables: + +**volume** (**Required**, percentage): The volume to set the media player to. See Also -------- diff --git a/guides/automations.rst b/guides/automations.rst index ca1aada8c..fb457796b 100644 --- a/guides/automations.rst +++ b/guides/automations.rst @@ -393,6 +393,7 @@ All Actions - :ref:`number.set ` / :ref:`number.to_min ` / :ref:`number.to_max ` / :ref:`number.decrement ` / :ref:`number.increment ` / :ref:`number.operation ` - :ref:`select.set ` / :ref:`select.set_index ` / :ref:`select.first ` / :ref:`select.last ` / :ref:`select.previous ` / :ref:`select.next ` / :ref:`select.operation ` - :ref:`media_player.play ` / :ref:`media_player.pause ` / :ref:`media_player.stop ` / :ref:`media_player.toggle ` + / :ref:`media_player.volume_up ` / :ref:`media_player.volume_down ` / :ref:`media_player.volume_set ` .. _config-condition: From 856f2f301fe8a058c4cccf37722e3c65abc4f9f2 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Mon, 13 Jun 2022 13:32:45 +1200 Subject: [PATCH 2/4] Bump version to 2022.6.0b3 --- Doxygen | 2 +- Makefile | 2 +- _static/version | 2 +- conf.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Doxygen b/Doxygen index 61f4f4495..935f0f618 100644 --- a/Doxygen +++ b/Doxygen @@ -38,7 +38,7 @@ PROJECT_NAME = "ESPHome" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 2022.6.0b2 +PROJECT_NUMBER = 2022.6.0b3 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/Makefile b/Makefile index 8020558b1..8e5591e0a 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ ESPHOME_PATH = ../esphome -ESPHOME_REF = 2022.6.0b2 +ESPHOME_REF = 2022.6.0b3 .PHONY: html html-strict cleanhtml deploy help live-html Makefile netlify netlify-api api netlify-dependencies svg2png copy-svg2png minify diff --git a/_static/version b/_static/version index 677e9c706..1559d289c 100644 --- a/_static/version +++ b/_static/version @@ -1 +1 @@ -2022.6.0b2 \ No newline at end of file +2022.6.0b3 \ No newline at end of file diff --git a/conf.py b/conf.py index 737984f07..5d4e88600 100644 --- a/conf.py +++ b/conf.py @@ -68,7 +68,7 @@ author = "ESPHome" # The short X.Y version. version = "2022.6" # The full version, including alpha/beta/rc tags. -release = "2022.6.0b2" +release = "2022.6.0b3" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. From b284b7414f269908da325aa10eed7b6be5932c11 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Mon, 13 Jun 2022 13:33:17 +1200 Subject: [PATCH 3/4] Update changelog for 2022.6.0b3 --- changelog/2022.6.0.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelog/2022.6.0.rst b/changelog/2022.6.0.rst index 17f0ce2b3..7671400c7 100644 --- a/changelog/2022.6.0.rst +++ b/changelog/2022.6.0.rst @@ -112,6 +112,7 @@ Beta Changes - publish fan speed count for discovery :esphomepr:`3537` by :ghuser:`ssieb` - Nextion brightness setting requires an assignment :esphomepr:`3533` by :ghuser:`nagyv` +- Implement media player volume actions :esphomepr:`3551` by :ghuser:`jesserockz` All changes ^^^^^^^^^^^ @@ -155,6 +156,7 @@ All changes - RG15 data is float/double, not int :esphomepr:`3512` by :ghuser:`wtremmel` - publish fan speed count for discovery :esphomepr:`3537` by :ghuser:`ssieb` - Nextion brightness setting requires an assignment :esphomepr:`3533` by :ghuser:`nagyv` +- Implement media player volume actions :esphomepr:`3551` by :ghuser:`jesserockz` Past Changelogs From 8c562ad95aeba44d238180155a0732ea2f5b6b59 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Mon, 13 Jun 2022 13:33:51 +1200 Subject: [PATCH 4/4] Update supporters for 2022.6.0b3 --- guides/supporters.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/supporters.rst b/guides/supporters.rst index e2520e5fb..dafaf10e3 100644 --- a/guides/supporters.rst +++ b/guides/supporters.rst @@ -855,4 +855,4 @@ Contributors - `Michael Labuschke (@zigman79) `__ - `Christian Zufferey (@zuzu59) `__ -*This page was last updated June 9, 2022.* +*This page was last updated June 13, 2022.*