Skip to content
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

Extended XMTZC05HM decoder #74

Merged
merged 4 commits into from
Feb 21, 2022

Conversation

DigiH
Copy link
Member

@DigiH DigiH commented Feb 20, 2022

  • Extension of model and property condtions by @h2zero to allow for the extension of the XMTZC05HM decoder
  • Pulled back _XMTZC05HM_json_props into XMTZC05HM_json.h
  • Renamed "model" to more informative "Mi_Body_Scale_2" and amended description in the docs
  • Implemented 'stabilised' only decoding for XMTZC05HM
  • Recognises 'stabilised' 2 (scale display active) and 'stabilised' a (scale display deactivated) to guarantee published 'stabilised' reading without the need for very short TimeBtwRead
  • New 'weighing_mode' attribute to indicate if the weighing was of a person or a small object (if this option is activated in the scale's settings). This allows filtering to only record person weighings in HA or openHAB
  • Only publish 'impedance' attribute if the weighing of a person was done barefoot and the impedance value could be recorded correctl
  • added all 12 possible variations in tests for now

I suspect that the 1st version of the Mi Body Composition Scale (XMTZCO2HM) is also being recognised by this decoder, and should therefor be mentioned in the docs and published model_id, but without confirmation from XMTZCO2HM owners this is just an assumption.

Checklist:

  • The pull request is done against the latest development branch
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • I accept the DCO.

DigiH and others added 3 commits February 19, 2022 19:26
- Pulled back _XMTZC05HM_json_props into XMTZC05HM_json.h
- Renamed "model" to more informative "Mi_Body_Scale_2" and amended description in the docs
- Implemented 'stabilised' only decoding for XMTZC05HM
- Recognises 'stabilised' 2 (scale display active) and 'stabilised' a (scale display deactivated) to guarantee published 'stabilised' reading without the need for very short TimeBtwRead
- New 'mode' attribute to indicate if the weighing was of a person or a small object (if this option is activated in the scale's settings). This allows filtering to only record person readings in HA or openHAB
- Only publish 'impedance' attribute if the weighing of a person was done barefoot and the impedance value could be recorded correctly

I suspect that the 1st version of the Mi Body Composition Scale (XMTZCO2HM) is also being recognised by this decoder, and should therefor be mentioned in the docs and published model_id, but without confirmation of XMTZCO2HM owners this is just a guess.
@DigiH
Copy link
Member Author

DigiH commented Feb 20, 2022

I shouldn't hurry with things like that ;) thanks

Copy link
Member

@h2zero h2zero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Small final changes
• abbreviated property names for discovery inclusion
• decoder back to original _XMTZC05HM_json

Correction of tests

Removed rogue old XMTZC05HM test result

Property name corrections

Fixed test mess up

Wrongly deleted test reinstated

Decoder clean up

Decoder clean up
@DigiH DigiH force-pushed the XMTZC05HM-Extended branch from e36642e to 788ea63 Compare February 21, 2022 18:02
@1technophile
Copy link
Member

Thanks!

@1technophile 1technophile merged commit 0f31a2b into theengs:development Feb 21, 2022
@DigiH DigiH deleted the XMTZC05HM-Extended branch February 22, 2022 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants