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 lock as a supported domain #8676

Closed
wants to merge 4 commits into from
Closed

Conversation

kylerw
Copy link

@kylerw kylerw commented Jul 27, 2017

Description:

Add a new domain to Emulated Hue

**Related issue (if applicable): N/A

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>

Example entry for configuration.yaml (if applicable):

emulated_hue:
  type: google_home
  host_ip: 192.168.1.188
  listen_port: 80
  exposed_domains:
    - light
    - fan
    - lock

Checklist:

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

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

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

@homeassistant
Copy link
Contributor

Hi @kylerw,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

service = SERVICE_LOCK
else:
service = SERVICE_UNLOCK

Choose a reason for hiding this comment

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

blank line contains whitespace

if service == SERVICE_TURN_ON:
service = SERVICE_LOCK
else:
service = SERVICE_UNLOCK

Choose a reason for hiding this comment

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

undefined name 'SERVICE_UNLOCK'

elif entity.domain == "lock":
domain = entity.domain
if service == SERVICE_TURN_ON:
service = SERVICE_LOCK

Choose a reason for hiding this comment

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

undefined name 'SERVICE_LOCK'

SERVICE_OPEN_COVER, SERVICE_CLOSE_COVER, STATE_ON, STATE_OFF,
HTTP_BAD_REQUEST, HTTP_NOT_FOUND, ATTR_SUPPORTED_FEATURES,
SERVICE_OPEN_COVER, SERVICE_CLOSE_COVER, SERVICE_LOCK, SERVICE_UNLOCK,
STATE_ON, STATE_OFF, HTTP_BAD_REQUEST, HTTP_NOT_FOUND, ATTR_SUPPORTED_FEATURES,

Choose a reason for hiding this comment

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

line too long (83 > 79 characters)

SERVICE_OPEN_COVER, SERVICE_CLOSE_COVER, STATE_ON, STATE_OFF,
HTTP_BAD_REQUEST, HTTP_NOT_FOUND, ATTR_SUPPORTED_FEATURES,
SERVICE_OPEN_COVER, SERVICE_CLOSE_COVER, SERVICE_LOCK, SERVICE_UNLOCK,
STATE_ON, STATE_OFF, HTTP_BAD_REQUEST, HTTP_NOT_FOUND,

Choose a reason for hiding this comment

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

trailing whitespace

@balloob
Copy link
Member

balloob commented Aug 1, 2017

Please add a test.

@kylerw
Copy link
Author

kylerw commented Aug 1, 2017

@balloob apologies for the ignorance. This is my first PR. It appears that tests for this need to go into /tests/components/emulated_hue/test_hue_api.py, is that correct?

looks like I should:

  • import lock
  • update hass_hue() to include run_until_complete() for lock
  • update test_discover_lights() to assert a lock is in devices
  • create test_put_light_state_lock()

Is this the right approach?

@balloob
Copy link
Member

balloob commented Aug 2, 2017

Yep 👍

@andrey-git
Copy link
Contributor

@kylerw any updates on this PR?

@kylerw
Copy link
Author

kylerw commented Aug 23, 2017

No update. Been traveling for work and unable to add a test.

@pvizeli
Copy link
Member

pvizeli commented Sep 1, 2017

You can reopen it after you add a test 👍

@pvizeli pvizeli closed this Sep 1, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Dec 11, 2017
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.

None yet

7 participants