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

Initial support for HomeKit enabled televisions #32404

Merged
merged 2 commits into from
Mar 5, 2020

Conversation

Jc2k
Copy link
Member

@Jc2k Jc2k commented Mar 2, 2020

Proposed change

This implements the most basic support for media_player entity type for homekit_controller. This is one of the more complicated HomeKit types so it deliberately starts small, additional features will be added by follow on pull requests. This only implements support for reading the current state (playing, paused, idle) and for the play, pause and stop service calls.

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

Additional information

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.

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.

The integration reached or maintains the following Integration Quality Scale:

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

@dmulcahey
Copy link
Contributor

I'll poke at this later tonight when I'm home to test it out. Thanks for adding this so quick!

@Jc2k
Copy link
Member Author

Jc2k commented Mar 2, 2020

@dmulcahey thanks! and no problem, had been putting off as no HK TV of my own, but knowing that another dev was available to help test was a big motivator :-)

"""State of the tv."""
homekit_state = self.get_hk_char_value(CharacteristicsTypes.CURRENT_MEDIA_STATE)
if homekit_state is None:
return STATE_UNKNOWN
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return None, let Home Assistant swap it out for STATE_UNKNOWN.

Suggested change
return STATE_UNKNOWN
return None

Copy link
Member

@balloob balloob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great ! One tiny commemt, ok to merge afterwards

@Jc2k Jc2k merged commit 007d934 into home-assistant:dev Mar 5, 2020
@Jc2k Jc2k deleted the homekit_controller_tv branch March 5, 2020 13:50
@lock lock bot locked and limited conversation to collaborators Mar 10, 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.

4 participants