-
-
Notifications
You must be signed in to change notification settings - Fork 28.6k
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
[WIP] HomeMatic KeyMatic works as a lock device #12384
Conversation
Hi @krys1976, 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! |
@@ -460,7 +462,8 @@ def _system_callback_handler(hass, config, src, *args): | |||
('cover', DISCOVER_COVER), | |||
('binary_sensor', DISCOVER_BINARY_SENSORS), | |||
('sensor', DISCOVER_SENSORS), | |||
('climate', DISCOVER_CLIMATE)): | |||
('climate', DISCOVER_CLIMATE), | |||
('lock', DISCOVER_LOCK)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
indentation contains mixed spaces and tabs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solved in newer commit
('sensor', DISCOVER_SENSORS), | ||
('climate', DISCOVER_CLIMATE) | ||
('lock', DISCOVER_LOCK)): | ||
# Get all devices of a specific type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains mixed spaces and tabs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solved in newer commit
('binary_sensor', DISCOVER_BINARY_SENSORS), | ||
('sensor', DISCOVER_SENSORS), | ||
('climate', DISCOVER_CLIMATE) | ||
('lock', DISCOVER_LOCK)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
indentation contains mixed spaces and tabs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solved in newer commit
Hope this push request works so far. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a reviewer or something like that, just pointing out some things I noticed.
@@ -0,0 +1,858 @@ | |||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this components/homematic/__init__.py
? If so, why did you copy it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked out current master and made my changes. In current master, this file still exists. May be dropped if not needed.
devices = [] | ||
for conf in discovery_info[ATTR_DISCOVER_DEVICES]: | ||
new_device = HMLock(conf) | ||
devices.append(new_device) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
devices.append(HMLock(conf))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did it the same way like in switch.homematic
def _init_data_struct(self): | ||
"""Generate the data dictionary (self._data) from metadata.""" | ||
self._state = "STATE" | ||
self._data.update({self._state: STATE_UNKNOWN}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just write self._data[self._state] = STATE_UNKNOWN
(I know the other homematic devices do it your way, but this is just much easier to parse in your head)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did it the same way like in switch.homematic
def update(self): | ||
"""Update state by device callback.""" | ||
self._state = (STATE_LOCKED if self.is_locked() | ||
else STATE_UNLOCKED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a Lock
component expert (nor a Homematic user), but I think this call is unnecessary because LockDevice
already handles this for you:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ... sure .. ;-)
Maby you can merge it or address the comments from this like the is_open property. |
This PR seems to have gone stale. Closing it. You can reopen it when you're ready to finish it. |
Description:
Related issue (if applicable): fixes #
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#4665
Checklist:
If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
tox
run successfully. Your PR cannot be merged unless tests passREQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.If the code does not interact with devices:
tox
run successfully. Your PR cannot be merged unless tests pass