Nerwyn / android-tv-card

Universal Customizable TV Remote Card, with HA actions, super configurable touchpad, slider, haptics, and keyboard
Apache License 2.0
183 stars 9 forks source link

support for fire tv on the keyboard #62

Closed armedad closed 4 months ago

armedad commented 4 months ago

the current keyboards don't work completely on fire tv. keys like backspace, delete, etc are handled differently than chromecast

i'd love to be able to override arbitrary keys. this would allow me to even replace the handling of alpha numerics. but alternatively alternate keyboard_mode like kodi (as you suggested in the community thread) would solve for these specific keys.

Nerwyn commented 4 months ago

Keyboards (seamless, textbox, and search) are programmed differently than regular buttons and wouldn't be remappable without a major rewrite. Adding new keyboard modes for different platforms makes more sense since there are a finite number of platforms and variations that need to be supported.

I opted to use the Android Remote API commands for backspace, delete, enter, arrow left, and arrow right since they're much more performant, but can create an alternate Fire TV keyboard mode which sends these commands via ADB. I'll work on this along with a couple of other feature requests for the next minor version and share a beta here when it's ready.

Nerwyn commented 4 months ago

Implemented in 3.4.0, which is still in alpha as I implement other feature requests. Set keyboard_mode to FIRE TV, and then backspace, delete, enter, and arrow left and right will be sent using ADB instead of the remote API.

Nerwyn commented 4 months ago

Ready to for testing and feedback in the latest beta!

Nerwyn commented 4 months ago

@armedad still waiting for your feedback

armedad commented 4 months ago

i'm getting "failed to call service/send_command, must contain at least one of entity_id, device_id, area_id

i only get that error on backspace/enter (don't have arrows to test). alpha numerics and other character keys work fine.

Nerwyn commented 4 months ago

I'm not getting that error in my testing. The entity ID for keyboard calls is being set here and is being done pretty much the same way as it's done for alphanumeric keys. Have you tried clearing cache? This sounds like it could be a caching issue.

armedad commented 4 months ago

yeah, i figured there wouldn't be a special separate code path, so it was a little confusing. i'll try clearing cache... but i was pretty sure i had. i'm also happy to jump into the js debugger and trace the calls, however i've never done that for a homeassistant add-on. is there a simple way or doc on how to install the uncompiled js? i'm happy to do that and trace at source level to verify

On Fri, Feb 23, 2024 at 12:22 AM Nerwyn @.***> wrote:

I'm not getting that error in my testing. The entity ID for keyboard calls is being set here https://github.com/Nerwyn/android-tv-card/blob/3.4.0-beta.006/src/classes/remote-keyboard.ts#L58-L63 and is being done pretty much the same way as it's done for alphanumeric keys. Have you tried clearing cache? This sounds like it could be a caching issue.

— Reply to this email directly, view it on GitHub https://github.com/Nerwyn/android-tv-card/issues/62#issuecomment-1960904813, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK7ZMOXMMMIGIOKS2QJIFATYVBGUZAVCNFSM6AAAAABDMYGTSSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRQHEYDIOBRGM . You are receiving this because you were mentioned.Message ID: @.***>

armedad commented 4 months ago

nevermind. all set. works great!

On Fri, Feb 23, 2024 at 8:34 AM chee @.***> wrote:

yeah, i figured there wouldn't be a special separate code path, so it was a little confusing. i'll try clearing cache... but i was pretty sure i had. i'm also happy to jump into the js debugger and trace the calls, however i've never done that for a homeassistant add-on. is there a simple way or doc on how to install the uncompiled js? i'm happy to do that and trace at source level to verify

On Fri, Feb 23, 2024 at 12:22 AM Nerwyn @.***> wrote:

I'm not getting that error in my testing. The entity ID for keyboard calls is being set here https://github.com/Nerwyn/android-tv-card/blob/3.4.0-beta.006/src/classes/remote-keyboard.ts#L58-L63 and is being done pretty much the same way as it's done for alphanumeric keys. Have you tried clearing cache? This sounds like it could be a caching issue.

— Reply to this email directly, view it on GitHub https://github.com/Nerwyn/android-tv-card/issues/62#issuecomment-1960904813, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK7ZMOXMMMIGIOKS2QJIFATYVBGUZAVCNFSM6AAAAABDMYGTSSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRQHEYDIOBRGM . You are receiving this because you were mentioned.Message ID: @.***>

Nerwyn commented 4 months ago

I'd have to reconfigure my build pipeline to spit out a non-minified copy of the card JS file, and I'm not sure if I want to deal with that headache. Glad to hear that it works!

armedad commented 4 months ago

yeah, not worth that time. esp since it was indeed just the caching issue. thanks so much for making these updates!

On Fri, Feb 23, 2024 at 10:38 AM Nerwyn @.***> wrote:

I'd have to reconfigure my build pipeline to spit out a non-minified copy of the card JS file, and I'm not sure if I want to deal with that headache. Glad to hear that it works!

— Reply to this email directly, view it on GitHub https://github.com/Nerwyn/android-tv-card/issues/62#issuecomment-1961813161, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK7ZMOS3PC7BQC6OPGEWDM3YVDOZ3AVCNFSM6AAAAABDMYGTSSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRRHAYTGMJWGE . You are receiving this because you were mentioned.Message ID: @.***>

Nerwyn commented 4 months ago

Added in 3.4.0