Implement 'volume_set' service for Android TV devices (#31161)
This commit is contained in:
1 parent
4c4f726323
commit
cd72128a80
5 files changed
+33
-3
No files matched your search
@@ -4,7 +4,7 @@
|
||||
"documentation": "https://www.home-assistant.io/integrations/androidtv",
|
||||
"requirements": [
|
||||
"adb-shell==0.1.1",
|
||||
"androidtv==0.0.38",
|
||||
"androidtv==0.0.39",
|
||||
"pure-python-adb==0.2.2.dev0"
|
||||
],
|
||||
"dependencies": [],
|
||||
|
||||
@@ -26,6 +26,7 @@ from homeassistant.components.media_player.const import (
|
||||
SUPPORT_TURN_OFF,
|
||||
SUPPORT_TURN_ON,
|
||||
SUPPORT_VOLUME_MUTE,
|
||||
SUPPORT_VOLUME_SET,
|
||||
SUPPORT_VOLUME_STEP,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
@@ -59,6 +60,7 @@ SUPPORT_ANDROIDTV = (
|
||||
| SUPPORT_SELECT_SOURCE
|
||||
| SUPPORT_STOP
|
||||
| SUPPORT_VOLUME_MUTE
|
||||
| SUPPORT_VOLUME_SET
|
||||
| SUPPORT_VOLUME_STEP
|
||||
)
|
||||
|
||||
@@ -631,6 +633,11 @@ class AndroidTVDevice(ADBDevice):
|
||||
"""Mute the volume."""
|
||||
self.aftv.mute_volume()
|
||||
|
||||
@adb_decorator()
|
||||
def set_volume_level(self, volume):
|
||||
"""Set the volume level."""
|
||||
self.aftv.set_volume_level(volume)
|
||||
|
||||
@adb_decorator()
|
||||
def volume_down(self):
|
||||
"""Send volume down command."""
|
||||
|
||||
Reference in new issue
Block a user