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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Report states #11973
Report states #11973
Conversation
assert msg['header']['name'] == 'Discover.Response' | ||
assert msg['header']['namespace'] == 'Alexa.Discovery' | ||
|
||
endpoint_ids = set(appliance['endpointId'] for appliance in msg['payload']['endpoints']) |
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.
line too long (92 > 79 characters)
if not self.properties_retrievable(): | ||
return | ||
|
||
properties = [] |
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.
local variable 'properties' is assigned to but never used
6777b2b
to
f86ba58
Compare
f86ba58
to
74a5f17
Compare
74a5f17
to
7061e39
Compare
7061e39
to
cc11ae0
Compare
cc11ae0
to
ea14e5f
Compare
No pylint, that function doesn't only return None. If you're so good at programming, why don't you open the PRs? |
Having an object per interface will make it easier to support properties. Ideally, properties are reported in context in all responses. However current implementation reports them only in response to a ReportState request. This seems to work sufficiently. As long as the device is opened in the Alexa app, Amazon will poll the device state every few seconds with a ReportState request.
ea14e5f
to
58ed62a
Compare
Fixes (mostly) home-assistant#11874. Other interfaces will need properties implemented as well. Implementing properties for just PowerController seems sufficient to eliminate the "There was a problem." error for any device that supports it, even if other interfaces are supported. Of course the additional properties will be reported incorrectly in the Alexa app. Includes a minor bugfix: `reportable` was previously placed incorrectly in the responses, so Amazon was ignoring it.
58ed62a
to
5eae9d1
Compare
Description:
This depends on #12016. For review purposes the first commit in this PR can be ignored, since it's in #12016.
This reports properties for PowerController, LockController, and BrightnessController. That should cover most use cases. It covers all the devices I have, at least 馃槃
I did some fairly extensive refactoring to make the implementation of properties more readable. Suggest reviewing commits individually. I'd like to refactor the tests some more as well since there's a lot of copy pasta there, but that can wait for another day.
Related issue (if applicable): fixes #11874
Checklist:
tox
run successfully. Your PR cannot be merged unless tests pass