@@ -53,6 +53,8 @@ Media Player Actions
53
53
All ``media_player `` actions can be used without specifying an ``id `` if you have only one ``media_player `` in
54
54
your configuration YAML.
55
55
56
+ The actions ``turn_off `` and ``turn_on `` are optional and based on the platform implementing the ``supports_turn_off_on `` trait.
57
+
56
58
Configuration variables:
57
59
58
60
**id ** (*Optional *, :ref: `config-id `): The media player to control. Defaults to the only one in YAML.
@@ -115,6 +117,20 @@ Configuration variables:
115
117
116
118
This action will pause or resume the current playback.
117
119
120
+ .. _media_player-turn_off :
121
+
122
+ ``media_player.turn_off `` Action
123
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
124
+
125
+ This action will turn off the media player.
126
+
127
+ .. _media_player-turn_on :
128
+
129
+ ``media_player.turn_on `` Action
130
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
131
+
132
+ This action will turn on the media player.
133
+
118
134
.. _media_player-volume_up :
119
135
120
136
``media_player.volume_up `` Action
@@ -230,6 +246,36 @@ This trigger is activated every time the media player plays an announcement.
230
246
on_announcement :
231
247
- logger.log : " Announcing!"
232
248
249
+ .. _media_player-on_turn_off_trigger :
250
+
251
+ ``media_player.on_turn_off `` Trigger
252
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
253
+
254
+ This trigger is activated every time the media player is turned off.
255
+
256
+ .. code-block :: yaml
257
+
258
+ media_player :
259
+ - platform : ... # any platform implementing the ``supports_turn_off_on`` trait
260
+ # ...
261
+ on_turn_off :
262
+ - logger.log : " Media Player is Turned Off"
263
+
264
+ .. _media_player-on_turn_on_trigger :
265
+
266
+ ``media_player.on_turn_on `` Trigger
267
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
268
+
269
+ This trigger is activated every time the media player is turned on.
270
+
271
+ .. code-block :: yaml
272
+
273
+ media_player :
274
+ - platform : ... # any platform implementing the ``supports_turn_off_on`` trait
275
+ # ...
276
+ on_turn_on :
277
+ - logger.log : " Media Player is Turned On"
278
+
233
279
.. _media_player-is_idle_condition :
234
280
235
281
``media_player.is_idle `` Condition
@@ -290,6 +336,36 @@ This condition checks if the media player is playing an announcement.
290
336
condition :
291
337
media_player.is_announcing :
292
338
339
+ .. _media_player-is_off_condition :
340
+
341
+ ``media_player.is_off `` Condition
342
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
343
+
344
+ This condition checks if the media player is turned off.
345
+
346
+ .. code-block :: yaml
347
+
348
+ # In some trigger:
349
+ on_... :
350
+ if :
351
+ condition :
352
+ media_player.is_off :
353
+
354
+ .. _media_player-is_on_condition :
355
+
356
+ ``media_player.is_on `` Condition
357
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
358
+
359
+ This condition checks if the media player is turned on.
360
+
361
+ .. code-block :: yaml
362
+
363
+ # In some trigger:
364
+ on_... :
365
+ if :
366
+ condition :
367
+ media_player.is_on :
368
+
293
369
Play media in order
294
370
-------------------
295
371
0 commit comments