-
Notifications
You must be signed in to change notification settings - Fork 119
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
Small changes - Accessory #117
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #117 +/- ##
==========================================
+ Coverage 50.86% 50.94% +0.08%
==========================================
Files 14 14
Lines 1337 1329 -8
Branches 138 138
==========================================
- Hits 680 677 -3
+ Misses 646 641 -5
Partials 11 11
|
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.
All good except one comment. Are you sure the commented change adds value?
@@ -487,12 +479,7 @@ def to_HAP(self): | |||
|
|||
.. seealso:: Accessory.to_HAP | |||
""" | |||
hap_rep = [super().to_HAP()] |
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 sure if this is more readable or more efficient than the previous version.
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 100% percent sure either. Just though about that line while I was working on the other PR and it looked pretty cool, especially since we already use list comprehensions in other places (mainly for the to_HAP
methods actually).
At least it isn't worse than the before IMO, and it cuts five lines.
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.
It's not worse, performance-wise I think. Just readability, but it's good enough, Merging
* Merge master back into dev (#111) * Fix typo in log message (#112) * Fix typo in SDS011 * Documentation improvements for version 2.0.0 (#114) * Replace event_loop with loop (#107) * Changelog update (#116) * Added entry for event loop change * Additional changes * Small changes - Accessory (#117) * Improved bridge.to_HAP * Updated changelog * Fix another typo in SDS011 which prevented pm10 from getting updates. * Added getter_callback to Characteristic #78 * Fix typo bridge.to_HAP (#119) * Adding Code Style Checker (#118) * Add basis for style checker * Fixed lint errors * Updated changelog * Improvements 7 - Config class (#120) Added a State class which keeps Accessory runtime properties such as port, address, paired clients, etc. This state is stored and managed by the driver. * Remove the pyhap.accessories package. (#115) * Remove the pyhap.accessories package. All accessories are temporarily moved to the root accessories folder. These will be moved into separate repositories as appropriate. pyhap.accessories is now an implicit namespace package. See pyhap/accessories/README.md for how others can share their accessories as HAP-python subpackages. * Release v2.1.0.
Changes
accessory.create
.iid_manager
andsetup_id
parameter fromaccessory
andbridge
init
calls.accessory.to_HAP()
In theory this is a breaking change. However it's not very likely many people have used those parameters to begin with since the defaults are quite fine. Therefor this shouldn't be an issue.
Some changes are extracted from #104. I didn't wanted to just propose a single new line ;)
In addition this will help keep the other PR clean.