Skip to content

Commit

Permalink
fix missing CMD_VOLUME_SET_COMMAND11
Browse files Browse the repository at this point in the history
  • Loading branch information
Nortonko committed Oct 10, 2023
1 parent 4a7bd04 commit ae0f179
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion androidtv/basetv/basetv.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def _cmd_volume_set(self):
"""
# Is this an Android 11 device?
if self.DEVICE_ENUM == constants.DeviceEnum.ANDROIDTV and self.device_properties.get("sw_version", "") == "11":
return constants.CMD_VOLUME_SET_COMMAND12
return constants.CMD_VOLUME_SET_COMMAND11

# Is this an Android 12 device?
if self.DEVICE_ENUM == constants.DeviceEnum.ANDROIDTV and self.device_properties.get("sw_version", "") == "12":
Expand Down
3 changes: 3 additions & 0 deletions androidtv/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ class DeviceEnum(IntEnum):
#: set volume
CMD_VOLUME_SET_COMMAND = "media volume --show --stream 3 --set {}"

#: set volume for an Android 11 device
CMD_VOLUME_SET_COMMAND11 = "cmd media_session volume --show --stream 3 --set {}"

#: set volume for an Android 12 device
CMD_VOLUME_SET_COMMAND12 = "cmd media_session volume --show --stream 3 --set {}"

Expand Down

0 comments on commit ae0f179

Please sign in to comment.