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

Add some tests for HomeKit Koogeek LS1 #22141

Merged
merged 1 commit into from Mar 19, 2019

Conversation

Projects
None yet
4 participants
@Jc2k
Copy link
Contributor

commented Mar 17, 2019

Description:

This is purely a test addition. In my configentry branch for homekit_controller I have a bunch of tests that actually make up the bulk of the remaining changes (as they ship with json), so i'm adding them seperately up front where possible so that the config entry stuff will be easier to review.

This is an example one, I have some similar ones lined up. I have taken a dump of the characteristic data for a Koogeek LS1 (my own) as JSON. This is in the same format that the device returns it. I can load that into my test harness to create a testing fake that supports the same features as a real Koogeek LS1. For example, I can assert that the LS1 doesn't support colour temperature (at least with my firmware revision). This means I can pin down if something changes the supported_features for an entity unexpectedly, and that nothing breaks the entity id, unique id or friendly name of a device by accident.

When the configentry stuff lands i'll also make some assertions about the device registry entries too.

I've also added some tests around known homekit_controller failure modes that the Koogeek LS1 did have.

If this sort of test is acceptable I have similar ones lined up for Ecobee 3, Aqara Gateway and Lennox E30.

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

@ghost ghost added the in progress label Mar 17, 2019

@Jc2k

This comment has been minimized.

Copy link
Contributor Author

commented Mar 18, 2019

(I guess this should probably be tagged with homekit_controller?)

@awarecan

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2019

Our label bot cannot deal with pure test changes

@awarecan awarecan merged commit c2aa06d into home-assistant:dev Mar 19, 2019

4 checks passed

Hound No violations found. Woof!
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 93.002%
Details

@ghost ghost removed the in progress label Mar 19, 2019

@Jc2k Jc2k deleted the Jc2k:homekit_koogeek_test branch Mar 19, 2019

entity_registry = await hass.helpers.entity_registry.async_get_registry()

# Assert that the entity is correctly added to the entity registry
entity = entity_registry.async_get('light.testdevice')

This comment has been minimized.

Copy link
@MartinHjelmare

MartinHjelmare Mar 19, 2019

Member

This is an entry and not an entity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.