esphome
esphome copied to clipboard
add xiaomi mccgq02hl
What does this implement/fix?
Add support for Xiaomi MCCGQ02HL based on @kar-vin-nen work in https://github.com/esphome/feature-requests/issues/978
Types of changes
- [x] New feature (non-breaking change which adds functionality)
Related issue or feature (if applicable): fixes https://github.com/esphome/feature-requests/issues/978
Pull request in esphome-docs with documentation (if applicable): https://github.com/esphome/esphome-docs/pull/1078
Test Environment
- [x] ESP32
- [ ] ESP8266
- [ ] Windows
- [ ] Mac OS
- [x] Linux
Example entry for config.yaml
:
sensor:
binary_sensor:
- platform: xiaomi_mccgq02hl
name: door sensor
mac_address: MA:C_:AD:DR:ES:S1
bindkey: "bind_key"
battery_level:
name: "Door sensor battery level"
light:
name: "Door sensor light"
opening:
name: "Door sensor open"
Explain your changes
Port of feature request to pull request.
Checklist:
- [x] The code change is tested and works locally.
- [ ] Tests have been added to verify that the new code works (under
tests/
folder).
If user exposed functionality or configuration variables are added/changed:
- [x] Documentation added/updated in esphome-docs.
Working sensors within my Homeassistant:
WTF guys just merge that stuff, it works!
Thanks for the review, i'v adjusted the code. Seems like i'm stumbling over sorting issue of constants which are in wrong order even without my changes. Any clue how to automatically order them without doing by hand?
Hi, Is there still any hope for this?
Thanks for the review, i'v adjusted the code. Seems like i'm stumbling over sorting issue of constants which are in wrong order even without my changes. Any clue how to automatically order them without doing by hand?
@morph027 I'm no expert, but check out the two error's I've picked out of the extensive list of errors. If you fix those two (and the fix is described) the sorting should be sorted I think.
Error: ERROR esphome/const.py:278:1 - Constant CONF_HAS_LIGHT = "has_light" is not ordered, please make sure all constants are ordered. See line 278 (should go to line 224, CONF_HEARTBEAT = "heartbeat")
Error: ERROR esphome/const.py:368:1 - Constant CONF_OPEN = "open" is not ordered, please make sure all constants are ordered. See line 368 (should go to line 364, CONF_OPEN_ACTION = "open_action")
any chance this pr will be merged? thx
any chance this pr will be merged? thx
Someone needs to fix my review comments & test whether it still works.
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions.
Uh, forgot about this. Will try to fix the comments.
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions.
Sorry, i am not really experienced with the process here. What is the next step on this integration ? Does the current state means that it will be given up ?
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 53.78%. Comparing base (
4d8b5ed
) to head (af4cf00
). Report is 861 commits behind head on dev.
Additional details and impacted files
@@ Coverage Diff @@
## dev #1645 +/- ##
==========================================
+ Coverage 53.70% 53.78% +0.07%
==========================================
Files 50 50
Lines 9408 9660 +252
Branches 1654 1704 +50
==========================================
+ Hits 5053 5196 +143
- Misses 4056 4140 +84
- Partials 299 324 +25
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.