esphome icon indicating copy to clipboard operation
esphome copied to clipboard

add xiaomi mccgq02hl

Open morph027 opened this issue 3 years ago • 13 comments

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:

morph027 avatar Mar 27 '21 15:03 morph027

Working sensors within my Homeassistant:

Screenshot from 2021-03-28 13-30-19

Screenshot from 2021-03-28 13-30-05

morph027 avatar Mar 28 '21 11:03 morph027

WTF guys just merge that stuff, it works!

shohart avatar Apr 02 '21 15:04 shohart

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 avatar Apr 06 '21 13:04 morph027

Hi, Is there still any hope for this?

maciak avatar Apr 24 '21 22:04 maciak

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")

randysnel avatar May 11 '21 08:05 randysnel

any chance this pr will be merged? thx

reno-pensando avatar Oct 14 '21 04:10 reno-pensando

any chance this pr will be merged? thx

Someone needs to fix my review comments & test whether it still works.

oxan avatar Oct 14 '21 08:10 oxan

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.

github-actions[bot] avatar Jan 13 '22 01:01 github-actions[bot]

Uh, forgot about this. Will try to fix the comments.

morph027 avatar Jan 13 '22 07:01 morph027

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.

github-actions[bot] avatar Apr 17 '22 00:04 github-actions[bot]

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 ?

cdu913 avatar Apr 22 '22 19:04 cdu913

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.

github-actions[bot] avatar Jul 25 '22 00:07 github-actions[bot]

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.

codecov-commenter avatar Jun 26 '24 03:06 codecov-commenter