Skip to content

Improve Homekit media_player options#14637

Merged
balloob merged 5 commits intohome-assistant:devfrom
cdce8p:homekit-entity_config-features
May 28, 2018
Merged

Improve Homekit media_player options#14637
balloob merged 5 commits intohome-assistant:devfrom
cdce8p:homekit-entity_config-features

Conversation

@cdce8p
Copy link
Copy Markdown
Member

@cdce8p cdce8p commented May 26, 2018

Description:

The goal of this PR is to replace the entity_config mode option for media_player entities with the feature_list. Since the media_player #14446 isn't yet merged into rc or master this would not technical be a breaking change. Using the proposed config allows for more flexibility down the road, has more resemblance to the platform config logic and thus will probably be a bit easier to understand.

The config change aside, homekit will not add all supported features for media_players anymore by default, since in most cases added four separate switches for on / off, play / pause, play / stop, mute / unmute insn't desired.

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#5447

Example entry for configuration.yaml (if applicable):

# Current version to add support for media_player modes
homekit:
  entity_config:
    media_player.bedroom:
      name: Player  # Other value (not changed)
      mode:
        - on_off
        - toggle_mute

# Proposed solution
homekit:
  entity_config:
    media_player.bedroom:
      name: Player  # Other value (not changed)
      feature_list:
        - feature: on_off
          name: On / Off   # Not yet implemented
          # Additional parameter for each feature can be inserted here.
        - feature: toggle_mute

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • Documentation added/updated in home-assistant.github.io
  • Tests have been added to verify that the new code works.

CC: @schmittx

@balloob balloob merged commit 6f4dd7b into home-assistant:dev May 28, 2018
@cdce8p cdce8p deleted the homekit-entity_config-features branch May 28, 2018 18:44
@balloob balloob mentioned this pull request Jun 8, 2018
girlpunk pushed a commit to girlpunk/home-assistant that referenced this pull request Sep 4, 2018
* Optimize imports

* Optimize name

* Optimize config schema

* Rename mode to feature

* Replace mode with feature_list
@home-assistant home-assistant locked and limited conversation to collaborators Sep 5, 2018
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