Fix position of add_entities of binary sensor#22866
Conversation
bachya
left a comment
There was a problem hiding this comment.
Can be merged when build passes.
Codecov Report
@@ Coverage Diff @@
## dev #22866 +/- ##
==========================================
+ Coverage 93.83% 93.83% +<.01%
==========================================
Files 448 448
Lines 36528 36528
==========================================
+ Hits 34275 34277 +2
+ Misses 2253 2251 -2
Continue to review full report at Codecov.
|
|
I actually wanted to ad the second commit as a different pull request, but ended up commiting it instead, so I have updated the description. Hope that works! Thanks guys! |
|
If you remove the new feature this fix can be merged into 0.91.2. |
| PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ | ||
| vol.Optional(CONF_HOST, default=DEFAULT_HOST): cv.string, | ||
| vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, | ||
| vol.Optional(CONF_CODE, 'code validation'): cv.string, |
There was a problem hiding this comment.
It is if defined in configuration.yaml. If not it will be None. I was trying to make it as much as the Manual Alarm Panel as possible:
https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/manual/alarm_control_panel.py
see ln 77
is that in error too?
Are you suggesting adding:
| vol.Optional(CONF_CODE, 'code validation'): cv.string, | |
| DEFAULT_CODE = None | |
| vol.Optional(CONF_CODE, default=DEFAULT_CODE): cv.string, |
Obviously shouldn't be committed like that, but at the appropriate places.
How would I go about removing the new feature fro the PR? Just recommit with the original file without changes?
There was a problem hiding this comment.
You are mixing things up here. The string "code validation" at alarm_control_panel.py is the identifier between the different vol.Exclusive options. What about:
vol.Optional(CONF_CODE): cv.string,
There was a problem hiding this comment.
Yes. You can recommit the initial file and check the diff here afterwards.
There was a problem hiding this comment.
I have made a commit with the original file and updated the comment to only address the fix. Does it look ok?
Removed added feature and sticking to bugfix
|
Removed the added feature and now back to just the one fix. Hopefully it can be added into 0.91.2. |
|
You missed the train. I created 0.91.3 milestone and assigned. |
* Bugfix - binary_sensor.py * Added features to Concord232 Alarm Panel * Added New Line End Of File * Deleted Whitespace * Back to original Removed added feature and sticking to bugfix
Description: Add_entities is wrongly placed inside loop, so it ads the same sensor multiple times creating errors during HA restart.
Checklist:
tox. Your PR cannot be merged unless tests pass