pyatv icon indicating copy to clipboard operation
pyatv copied to clipboard

Power State not updating for media_player or remote device in HomeAssistant

Open hayatae opened this issue 6 years ago • 3 comments

Just now trying out this beta integration with my Apple TV 4th Gen running tvOS 13.

It connected fine and media states and play progress appear to be updating fine. But when I put the apple tv into sleep mode, it still shows as being "on" (nothing playing) in the home assistant media entity. If I turn off the media player in home assistant and then turn on the Apple TV via its physical remote, the media player entity never shows as "on" or shows any updates about what is currently playing until I press the "power on" button for the media player in home assistant.

It seems like putting the device to sleep and waking it back up doesn't cause any state changes in home assistant? I'd like to be able to write an automation that triggers when the ATV goes to sleep or wakes up from sleep. Is this simply available on a different state variable other than the media player on/off state, or is this a power state tracking bug?

System Setup

  • pyatv: 0.5.0 update 4
  • Apple TV: Apple TV 4th gen tvOS 13.4

hayatae avatar Apr 12 '20 14:04 hayatae

No power management related features are currently implemented, it will come as a later addition via https://github.com/postlund/hass-atv-beta/pull/2. So the behavior you are seeing is expected (but maybe not desired).

postlund avatar Apr 12 '20 17:04 postlund

Ah, got it! Thank you for the quick response. I'll close out this issue since it's on the list of features to be implemented and simply not done yet.

hayatae avatar Apr 12 '20 17:04 hayatae

Sounds good! 👍 I hope to be able to push things along soon to get some momentum. It's rather slow getting the uplift in to Home Assistant at the moment.

postlund avatar Apr 12 '20 17:04 postlund