zha-device-handlers icon indicating copy to clipboard operation
zha-device-handlers copied to clipboard

Add support for _TZE200_yi4jtqq1 illuminance sensor.

Open gmsoft-tuxicoman opened this issue 2 years ago • 5 comments

This is a simple illuminance sensort with a maximum of 1000 lumen. So it's only really suited for inside, not outside.

The quirk provide both the raw lumen value as well as the low/medium/high brightness level.

gmsoft-tuxicoman avatar Sep 29 '22 07:09 gmsoft-tuxicoman

Pull Request Test Coverage Report for Build 3291717546

  • 25 of 25 (100.0%) changed or added relevant lines in 1 file are covered.
  • 27 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.5%) to 80.509%

Files with Coverage Reduction New Missed Lines %
zhaquirks/xiaomi/init.py 27 83.79%
<!-- Total: 27
Totals Coverage Status
Change from base Build 3212112661: 0.5%
Covered Lines: 6043
Relevant Lines: 7506

💛 - Coveralls

coveralls avatar Sep 29 '22 07:09 coveralls

Codecov Report

Base: 80.00% // Head: 80.50% // Increases project coverage by +0.50% :tada:

Coverage data is based on head (69aec27) compared to base (2292c4e). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1795      +/-   ##
==========================================
+ Coverage   80.00%   80.50%   +0.50%     
==========================================
  Files         239      241       +2     
  Lines        7430     7506      +76     
==========================================
+ Hits         5944     6043      +99     
+ Misses       1486     1463      -23     
Impacted Files Coverage Δ
zhaquirks/tuya/ts0601_illuminance.py 100.00% <100.00%> (ø)
zhaquirks/tuya/ts001x.py 100.00% <0.00%> (ø)
zhaquirks/lidl/TS0501A.py 100.00% <0.00%> (ø)
zhaquirks/lixee/zlinky.py 100.00% <0.00%> (ø)
zhaquirks/lixee/__init__.py 100.00% <0.00%> (ø)
zhaquirks/inovelli/VZM31SN.py 100.00% <0.00%> (ø)
zhaquirks/tuya/air/ts0601_air_quality.py 100.00% <0.00%> (ø)
zhaquirks/xiaomi/aqara/plug_mmeu01.py
zhaquirks/gledopto/glc009.py 100.00% <0.00%> (ø)
zhaquirks/xiaomi/aqara/plug_eu.py 100.00% <0.00%> (ø)
... and 1 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov-commenter avatar Sep 29 '22 07:09 codecov-commenter

Please rebase this and install / run the precommit checks

dmulcahey avatar Oct 01 '22 17:10 dmulcahey

@javicalle lmk what you think when you have a moment please. Thanks!

dmulcahey avatar Oct 10 '22 15:10 dmulcahey

Not happy with another ts0601_whatever.py file, but not sure if there is a better fit. Keep as is for now.

The TuyaIlluminanceMeasurement must be moved to a generic class. I like the security code check, but not sure if it is correct (I believe that would be something like if x > 1 else 0 or maybe a parenthesis is needed here). Keep as is and I will move in another PR.

The device doesn't have a battery report? The new implementation would log any not implemented report (warning level).

javicalle avatar Oct 12 '22 10:10 javicalle

I've made all the changes.

This device doesn't have a battery sensor as it's USB powered.

gmsoft-tuxicoman avatar Oct 20 '22 13:10 gmsoft-tuxicoman