Skip to content

Keyboard Listener #2841

@poll-97

Description

@poll-97

What do you need help with?

Hi everyone,

I'm not sure if the tag is correct, maybe I'm doing something wrong, so I won't file a bug report for now.

Basically, despite having paired all three protocols, the keyboard listener event never fires when I go to a text area. I'm using the latest version of TvOS and the latest version of pyatv.

I basically tried extending the pyatv listener class in an external script to try and integrate it, but it's not working. Below is what I tried.

class KeyboardListener(pyatv.interface.KeyboardListener):
     def init(self, parent_apple_tv, identifier):
         self.parent_apple_tv = parent_apple_tv
         self.identifier = identifier
         LOGGER.debug(f"{self.identifier} - Keyboard listener initialized")

     def focusstate_update(self, old_state, new_state):
         LOGGER.debug(f"{self.identifier} - keyboard: old_state={old_state}, new_state={new_state}")
         message = {"old_status": old_state.value, "new_status": new_state.value}
         data = {"cmd": "keyboard_status", "message": message}
         asyncio.create_task(self.parent_apple_tv.publish_message(data))

It prints the Initialization log, but not the entire focus section.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions