Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support volume level push updates in apple_tv integration #93496

Merged
merged 2 commits into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion homeassistant/components/apple_tv/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"documentation": "https://www.home-assistant.io/integrations/apple_tv",
"iot_class": "local_push",
"loggers": ["pyatv", "srptools"],
"requirements": ["pyatv==0.11.0"],
"requirements": ["pyatv==0.12.0"],
"zeroconf": [
"_mediaremotetv._tcp.local.",
"_companion-link._tcp.local.",
Expand Down
8 changes: 8 additions & 0 deletions homeassistant/components/apple_tv/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ def async_device_connected(self, atv: AppleTV) -> None:
# Listen to power updates
self.atv.power.listener = self

# Listen to volume updates
self.atv.audio.listener = self

if self.atv.features.in_state(FeatureState.Available, FeatureName.AppList):
self.hass.create_task(self._update_app_list())

Expand Down Expand Up @@ -203,6 +206,11 @@ def powerstate_update(self, old_state: PowerState, new_state: PowerState) -> Non
"""Update power state when it changes."""
self.async_write_ha_state()

@callback
def volume_update(self, old_level: float, new_level: float) -> None:
"""Update volume when it changes."""
self.async_write_ha_state()

@property
def app_id(self) -> str | None:
"""ID of the current running app."""
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,7 @@ pyatmo==7.5.0
pyatome==0.1.1

# homeassistant.components.apple_tv
pyatv==0.11.0
pyatv==0.12.0

# homeassistant.components.aussie_broadband
pyaussiebb==0.0.15
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ pyatag==0.3.5.3
pyatmo==7.5.0

# homeassistant.components.apple_tv
pyatv==0.11.0
pyatv==0.12.0

# homeassistant.components.aussie_broadband
pyaussiebb==0.0.15
Expand Down