shenxn / libdyson

Python library for dyson devices
Apache License 2.0
62 stars 41 forks source link

Identify 438E as Pure Cool Formaldehyde, and add formaldehyde env data #12

Closed seanrees closed 3 years ago

seanrees commented 3 years ago

Hey there, this is motivated by seanrees/prometheus-dyson#13 to support the Dyson Pure Cool Formaldehyde. After chatting with the requestor, we identified this as model 438E.

This creates a new DysonPureCoolFormaldehyde class in dyson_pure_cool.py. As far as I can tell, the new model behaves just like a PureCool but with the extra metric. So in this case I simply added it to dyson_pure_cool.py and extended directly from DysonPureCool. I also updated the references throughout libdyson from PURE_COOL_2021 to PURE_COOL_FORMALDEHYDE.

I didn't add a test for this. I wanted to run this design by you first before I did -- if there's another way you prefer this to be implemented, let me know. :-)

codecov[bot] commented 3 years ago

Codecov Report

Merging #12 (dd1aba8) into main (ff136d2) will increase coverage by 0.00%. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #12   +/-   ##
=======================================
  Coverage   99.04%   99.05%           
=======================================
  Files          21       21           
  Lines         941      948    +7     
=======================================
+ Hits          932      939    +7     
  Misses          9        9           
Impacted Files Coverage Δ
libdyson/__init__.py 100.00% <100.00%> (ø)
libdyson/const.py 100.00% <100.00%> (ø)
libdyson/dyson_pure_cool.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ff136d2...dd1aba8. Read the comment docs.

seanrees commented 3 years ago

Gentle ping on this @shenxn ? (looking for directional feedback :))

seanrees commented 3 years ago

Thanks, added a test.