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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 11 additions & 2 deletions homeassistant/components/emulated_hue/hue_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
from homeassistant import core
from homeassistant.const import (
ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON, SERVICE_VOLUME_SET,
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,
)
from homeassistant.components.light import (
ATTR_BRIGHTNESS, SUPPORT_BRIGHTNESS
Expand Down Expand Up @@ -209,6 +210,14 @@ def put(self, request, username, entity_number):
else:
service = SERVICE_CLOSE_COVER

# If the requested entity is a lock, convert to lock/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'

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'


# If the requested entity is a fan, convert to speed
elif entity.domain == "fan":
if entity_features & SUPPORT_SET_SPEED:
Expand Down