unfoldedcircle / feature-and-bug-tracker

Feature and bug tracker repository for Unfolded Circle products
22 stars 0 forks source link

[bug] Sony Android TV Integration - Power On Off #218

Closed DennisFre closed 1 month ago

DennisFre commented 7 months ago

Is there an existing issue for this?

Description

If I add a Android TV Integration im not able to discrete turn on and off the TV. It is just every time a on/off toggle.

How to Reproduce

  1. Add Android TV Integration
  2. Press Power On -> TV Turns On
  3. Press Power On -> TV Turns Off

Expected behavior

  1. Add Android TV Integration
  2. Press Power On -> TV Turns On
  3. Press Power On -> TV stays On

System version

1.4.8

What part of the system affected by the problem?

Integration

Additional context

No response

splattner commented 5 months ago

I guess the problem is not the remote but the android tv remote protocol. The python library used by the intergration only support a power (toggle) KEYCODE_POWER here we see that this command is used.

Maybee KEYCODE_SLEEP and KEYCODE_WAKEUP would be the better choice?

uvjim commented 5 months ago

Also seeing the issue and think it might be causing some weirdness in activity groups but I'm yet to try and get to the root cause of that.

kennymc-c commented 4 months ago

When I still had a Sony Android TV (XE9005) I had no problems powering it on and off via the Android TV integration. Maybe it's a network or setting issue? Or just newer Android TV versions have this problem as my TV was from 2017 running Android TV 9.

uvjim commented 4 months ago

I don't think my issue is related to the power toggling rather than being discrete. I did a quick check in the code and it appears to rely on the imported package telling it the state rather than calculating it itself.

I haven't had a chance to look any further, however having discrete power options would be easier when trying to fix things if they get out of sync in some way.

zehnm commented 3 months ago

The current power state is now considered before sending the power toggle command. Unfortunately the Android TV remote protocol only defines a power toggle command. Other commands like SLEEP and WAKEUP don't work on every device. With the newly introduced device profiles and the keycode testing function, we can create device specific profiles where this commands are supported.

The new Android TV integration version will soon be released in beta channel.

zehnm commented 3 months ago

Included in the just released beta firmware 1.7.9 and will be part of the next public release.

zehnm commented 1 month ago

Fixed in release 1.7.12