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 arrow keys for ATV4 #59

Merged
merged 1 commit into from
Apr 18, 2017
Merged

Support arrow keys for ATV4 #59

merged 1 commit into from
Apr 18, 2017

Conversation

postlund
Copy link
Owner

This is the quick-n-easy solution where I ignore the fact that ATV3 does not seem to support these commands. But since it just ignores them I find it to be good enough since it does not increase complexity of handling multiple device types in the library.

I have not verified if this PR works since I don't own a gen 4 device, so if someone can help me with that I would be grateful. Will not merge until verification is done.

@coveralls
Copy link

coveralls commented Mar 11, 2017

Coverage Status

Coverage decreased (-0.07%) to 96.482% when pulling cd6ac22 on arrow_keys_atv4 into 8937e86 on master.

@postlund
Copy link
Owner Author

@dale3h Could you maybe help me out and verify this? 😄 I would like to get it in for 0.3.0 so I can add additional controls to Home Assistant.

@dale3h
Copy link

dale3h commented Mar 20, 2017

Yes, I will try this once I return home this week.

@postlund
Copy link
Owner Author

postlund commented Apr 4, 2017

@dale3h Did you ever get around to try this out? 😄

@dale3h
Copy link

dale3h commented Apr 4, 2017

No, I apologize, I have not. To be honest, I completely forgot!

I will set myself a location-based reminder so that it alerts me anytime I get home, that way I can make sure that I get it tested.

@dale3h
Copy link

dale3h commented Apr 7, 2017

It doesn't seem to work when using atvremote <key>. Here is the debug output:

$ atvremote --version
atvremote 0.2.3.dev1

$ atvremote --address XXX.XXX.XXX.XXX --login_id 00000000-0000-0000-0000-000000000000 --debug up
DEBUG: GET URL: http://XXX.XXX.XXX.XXX:3689/login?hsgid=00000000-0000-0000-0000-000000000000&hasFP=1
DEBUG: Data[32]: b'6d6c6f67000000186d73747400000004000000c86d6c69640000000400000017'
DEBUG: _login_request: mlog: [container, dmap.loginresponse]
  mstt: 200 [uint, dmap.status]
  mlid: 23 [uint, dmap.sessionid]

INFO: Logged in and got session id 23
DEBUG: GET URL: http://XXX.XXX.XXX.XXX:3689/ctrl-int/1/playstatusupdate?session-id=23&revision-number=0
DEBUG: Data[155]: b'636d7374000000936d73747400000004000000c8636d7372000000040000003763616673000000010063616665000000010063617665000000010063617673000000010063617073000000010363617368000000010063617270000000010063616172000000040000000663616173000000040000000263616b730000000101'...
DEBUG: _get_request: cmst: [container, dmcp.playstatus]
  mstt: 200 [uint, dmap.status]
  cmsr: 55 [uint, dmcp.serverrevision]
  cafs: 0 [uint, dacp.fullscreen]
  cafe: False [bool, dacp.fullscreenenabled]
  cave: False [bool, dacp.dacpvisualizerenabled]
  cavs: 0 [uint, dacp.visualizer]
  caps: 3 [uint, dacp.playstatus]
  cash: 0 [uint, dacp.shufflestate]
  carp: 0 [uint, dacp.repeatstate]
  caar: 6 [uint, dacp.albumrepeat]
  caas: 2 [uint, dacp.albumshuffle]
  caks: 1 [uint, unknown tag]
  casc: 1 [uint, unknown tag]
  cavc: True [bool, dacp.volumecontrollable]
  casu: 0 [uint, dacp.su]

DEBUG: Already logged in, re-using seasion id 23
DEBUG: POST URL: http://XXX.XXX.XXX.XXX:3689/ctrl-int/1/controlpromptentry?session-id=23&prompt-id=0
DEBUG: Data[0]: b''
DEBUG: _post_request: 

$ atvremote --address XXX.XXX.XXX.XXX --login_id 00000000-0000-0000-0000-000000000000 --debug down
DEBUG: GET URL: http://XXX.XXX.XXX.XXX:3689/login?hsgid=00000000-0000-0000-0000-000000000000&hasFP=1
DEBUG: Data[32]: b'6d6c6f67000000186d73747400000004000000c86d6c69640000000400000018'
DEBUG: _login_request: mlog: [container, dmap.loginresponse]
  mstt: 200 [uint, dmap.status]
  mlid: 24 [uint, dmap.sessionid]

INFO: Logged in and got session id 24
DEBUG: GET URL: http://XXX.XXX.XXX.XXX:3689/ctrl-int/1/playstatusupdate?session-id=24&revision-number=0
DEBUG: Data[155]: b'636d7374000000936d73747400000004000000c8636d7372000000040000003763616673000000010063616665000000010063617665000000010063617673000000010063617073000000010363617368000000010063617270000000010063616172000000040000000663616173000000040000000263616b730000000101'...
DEBUG: _get_request: cmst: [container, dmcp.playstatus]
  mstt: 200 [uint, dmap.status]
  cmsr: 55 [uint, dmcp.serverrevision]
  cafs: 0 [uint, dacp.fullscreen]
  cafe: False [bool, dacp.fullscreenenabled]
  cave: False [bool, dacp.dacpvisualizerenabled]
  cavs: 0 [uint, dacp.visualizer]
  caps: 3 [uint, dacp.playstatus]
  cash: 0 [uint, dacp.shufflestate]
  carp: 0 [uint, dacp.repeatstate]
  caar: 6 [uint, dacp.albumrepeat]
  caas: 2 [uint, dacp.albumshuffle]
  caks: 1 [uint, unknown tag]
  casc: 1 [uint, unknown tag]
  cavc: True [bool, dacp.volumecontrollable]
  casu: 0 [uint, dacp.su]

DEBUG: Already logged in, re-using seasion id 24
DEBUG: POST URL: http://XXX.XXX.XXX.XXX:3689/ctrl-int/1/controlpromptentry?session-id=24&prompt-id=0
DEBUG: Data[0]: b''
DEBUG: _post_request: 

$ atvremote --address XXX.XXX.XXX.XXX --login_id 00000000-0000-0000-0000-000000000000 --debug left
DEBUG: GET URL: http://XXX.XXX.XXX.XXX:3689/login?hsgid=00000000-0000-0000-0000-000000000000&hasFP=1
DEBUG: Data[32]: b'6d6c6f67000000186d73747400000004000000c86d6c69640000000400000019'
DEBUG: _login_request: mlog: [container, dmap.loginresponse]
  mstt: 200 [uint, dmap.status]
  mlid: 25 [uint, dmap.sessionid]

INFO: Logged in and got session id 25
DEBUG: GET URL: http://XXX.XXX.XXX.XXX:3689/ctrl-int/1/playstatusupdate?session-id=25&revision-number=0
DEBUG: Data[155]: b'636d7374000000936d73747400000004000000c8636d7372000000040000003763616673000000010063616665000000010063617665000000010063617673000000010063617073000000010363617368000000010063617270000000010063616172000000040000000663616173000000040000000263616b730000000101'...
DEBUG: _get_request: cmst: [container, dmcp.playstatus]
  mstt: 200 [uint, dmap.status]
  cmsr: 55 [uint, dmcp.serverrevision]
  cafs: 0 [uint, dacp.fullscreen]
  cafe: False [bool, dacp.fullscreenenabled]
  cave: False [bool, dacp.dacpvisualizerenabled]
  cavs: 0 [uint, dacp.visualizer]
  caps: 3 [uint, dacp.playstatus]
  cash: 0 [uint, dacp.shufflestate]
  carp: 0 [uint, dacp.repeatstate]
  caar: 6 [uint, dacp.albumrepeat]
  caas: 2 [uint, dacp.albumshuffle]
  caks: 1 [uint, unknown tag]
  casc: 1 [uint, unknown tag]
  cavc: True [bool, dacp.volumecontrollable]
  casu: 0 [uint, dacp.su]

DEBUG: Already logged in, re-using seasion id 25
DEBUG: POST URL: http://XXX.XXX.XXX.XXX:3689/ctrl-int/1/controlpromptentry?session-id=25&prompt-id=0
DEBUG: Data[0]: b''
DEBUG: _post_request: 

$ atvremote --address XXX.XXX.XXX.XXX --login_id 00000000-0000-0000-0000-000000000000 --debug right
DEBUG: GET URL: http://XXX.XXX.XXX.XXX:3689/login?hsgid=00000000-0000-0000-0000-000000000000&hasFP=1
DEBUG: Data[32]: b'6d6c6f67000000186d73747400000004000000c86d6c6964000000040000001a'
DEBUG: _login_request: mlog: [container, dmap.loginresponse]
  mstt: 200 [uint, dmap.status]
  mlid: 26 [uint, dmap.sessionid]

INFO: Logged in and got session id 26
DEBUG: GET URL: http://XXX.XXX.XXX.XXX:3689/ctrl-int/1/playstatusupdate?session-id=26&revision-number=0
DEBUG: Data[155]: b'636d7374000000936d73747400000004000000c8636d7372000000040000003763616673000000010063616665000000010063617665000000010063617673000000010063617073000000010363617368000000010063617270000000010063616172000000040000000663616173000000040000000263616b730000000101'...
DEBUG: _get_request: cmst: [container, dmcp.playstatus]
  mstt: 200 [uint, dmap.status]
  cmsr: 55 [uint, dmcp.serverrevision]
  cafs: 0 [uint, dacp.fullscreen]
  cafe: False [bool, dacp.fullscreenenabled]
  cave: False [bool, dacp.dacpvisualizerenabled]
  cavs: 0 [uint, dacp.visualizer]
  caps: 3 [uint, dacp.playstatus]
  cash: 0 [uint, dacp.shufflestate]
  carp: 0 [uint, dacp.repeatstate]
  caar: 6 [uint, dacp.albumrepeat]
  caas: 2 [uint, dacp.albumshuffle]
  caks: 1 [uint, unknown tag]
  casc: 1 [uint, unknown tag]
  cavc: True [bool, dacp.volumecontrollable]
  casu: 0 [uint, dacp.su]

DEBUG: Already logged in, re-using seasion id 26
DEBUG: POST URL: http://XXX.XXX.XXX.XXX:3689/ctrl-int/1/controlpromptentry?session-id=26&prompt-id=0
DEBUG: Data[0]: b''
DEBUG: _post_request: 

@postlund
Copy link
Owner Author

@dale3h I realized I did some stuff wrong and have now corrected issues I found. Would be great if you could re-test my latest push 😄

@coveralls
Copy link

coveralls commented Apr 18, 2017

Coverage Status

Coverage decreased (-0.06%) to 96.696% when pulling 2d687db on arrow_keys_atv4 into 54e5ea0 on master.

@msiedlarek
Copy link

@postlund Hello, another interested party here. Arrows are working for me after 2d687db on A1625, tvOS 10.2

@postlund
Copy link
Owner Author

postlund commented Apr 18, 2017

@msiedlarek Great, thanks for testing 😄 I'm gonna try to get this in ASAP.

@coveralls
Copy link

coveralls commented Apr 18, 2017

Coverage Status

Coverage decreased (-0.3%) to 96.442% when pulling d7624e6 on arrow_keys_atv4 into 8f2d427 on master.

@coveralls
Copy link

coveralls commented Apr 18, 2017

Coverage Status

Coverage decreased (-0.06%) to 96.684% when pulling d0993d8 on arrow_keys_atv4 into 8f2d427 on master.

@postlund postlund merged commit d335160 into master Apr 18, 2017
@postlund postlund deleted the arrow_keys_atv4 branch April 18, 2017 18:14
@postlund
Copy link
Owner Author

I tried this with my ATV3 now and it works as well, which is nice! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants