Add HomeKit Television functionality #22968
Conversation
# Conflicts: # homeassistant/components/homekit/util.py # tests/components/homekit/test_util.py
This comment has been minimized.
This comment has been minimized.
|
@adrum I'll probably start the review this weekend. In the meantime, could you extract the HAP-python update to a separate PR (and include the reordering of As for the general direction, I'm still debating if we should just make this a breaking change and support everything we can through the television type. The switches have always only been a placeholder until something better would came along. |
cdce8p
left a comment
There was a problem hiding this comment.
We're getting close here. I haven't looked at the tests yet, do you want/need to updated them?
As a side note, do you run local checks?
That way you could remove the need for lint fixes after the fact. Since tox is pretty slow, take a look at testing outside tox: doc. Especially I would recommend the following:
# (Activate virtual environment)
# Only use 'requirements_test', not 'test_all'
pip3 install -r requirements_test.txt
# Install HAP-python manually
pip3 install HAP-python
# When I test, I usually run:
script/lint
pytest tests/components/homekit/|
@cdce8p Thank you so much for sending that info over. I've been running tox locally and it is not ideal. I figured out how to specify targets and files, but it's still pretty slow. This will help greatly. I will take a look at your review in a few hours. I will update the tests to accommodate the changes. I will get those updated after I implement the review changes. |
|
@adrum Sounds good to me. As for the local tests, I figured that you were using tox since I had the exact same issue once. It's just so slow; the new way is way faster though, usually sub 30s for both comments 😁 |
cdce8p
left a comment
There was a problem hiding this comment.
It seems I show take a closer look at the suggestions I'm making 😅
Good catches
|
No problem! I think I've got the tests updated so it covers the whole file now. We shall see. I would say go ahead check out the tests whenever you feel the main file is ready. |
cdce8p
left a comment
There was a problem hiding this comment.
Just some last small changes for the accessory. Will look at the tests next
cdce8p
left a comment
There was a problem hiding this comment.
Some comments regarding the tests.
|
I've just pushed some last changes, but it seems as if it's finally ready. What do you think? |
|
@cdce8p This looks good to me! I was unaware of caplog. I will definitely keep that noted for future tests. |
|
@adrum Thanks for the great work you did to get this feature ready 🥇 🐬 |
Description:
CC: @cdce8p
This adds the ability to expose
media_playerentities as Television types in HomeKit. This is an opt-in feature, requiring users with devices iOS 12.2 or later to change themedia_playerentity'sdevice_class: tv.I plan to add the ability to link a
remotelater on for additional functionality.Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#9186
Example entry for
configuration.yaml(if applicable):Checklist:
tox. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code does not interact with devices: