Skip to content

Add remote control configuration options to HomeKit integration#34570

Closed
joogps wants to merge 3 commits intohome-assistant:devfrom
joogps:homekit
Closed

Add remote control configuration options to HomeKit integration#34570
joogps wants to merge 3 commits intohome-assistant:devfrom
joogps:homekit

Conversation

@joogps
Copy link
Copy Markdown
Contributor

@joogps joogps commented Apr 23, 2020

Proposed change

This pull request expands the capabilities of HomeKit media players (more specifically, TVs), by adding more configuration options to the iOS Control Center widget, which currently only supports play/pause and volume controls. (I know the tests and the docs weren't updated yet. I'll try to work on it tomorrow.)

Example of the iOS Control Center remote. Only the play/pause button and volume control (using the physical volume buttons) work.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example entry for configuration.yaml:

# Example configuration.yaml with remote entity and key remapping
homekit:
  entity_config:
    media_player.living_room_tv:
      remote:
        remote_id: remote.living_room_tv
        key_map:
          info: home

In this case, the user specifies a remote entity with remote_id and replaces the default info command, triggered by the i button, with home. When the info button is pressed, then the send_command service will be called with home as the value of command. The other key values (they're all defined in const.py, if you're curious), will remain the default ones.

# Example configuration.yaml with custom services
homekit:
  entity_config:
    media_player.living_room_tv:
      remote:
        key_map:
          up:
            service: webostv.button
            data:
              entity_id: media_player.living_room_tv
              button: UP

Here, supposing that the TV was integrated with the webOS integration, instead of defining a remote entity (which is currently not supported yet by webostv), the user defines a script, a service, in this case webostv.button, to be called when the up key is pressed.

All keys, except for the volume controls, can be remapped. It is possible to define services even if a remote is also specified.

This simpler version, for in case the keys don't need to be remapped, is also accepted:

# Example configuration.yaml without key remapping or custom services
  entity_config:
    media_player.living_room_tv:
      remote: remote.living_room_tv

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request: (To-do)

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works. (To-do)

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

@probot-home-assistant
Copy link
Copy Markdown

Hey there @bdraco, mind taking a look at this pull request as its been labeled with a integration (homekit) you are listed as a codeowner for? Thanks!

@joogps joogps mentioned this pull request Apr 23, 2020
20 tasks
@bdraco
Copy link
Copy Markdown
Member

bdraco commented Apr 23, 2020

@joogps Ideally the remote integration provides a key map for these instead of having to make the user configure it.

@joogps joogps closed this Apr 23, 2020
@joogps
Copy link
Copy Markdown
Contributor Author

joogps commented Apr 23, 2020

Pull request closed because of #34560 changes to bridge configuration

@lock lock Bot locked and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants