kellerza / pysma

Async library for SMA Solar's WebConnect interface
MIT License
59 stars 51 forks source link

Set res to 0 only if unit is "W" #94

Closed rklomp closed 2 years ago

rklomp commented 2 years ago

Fixes https://github.com/kellerza/pysma/issues/93 and https://github.com/home-assistant/core/issues/61838

As setting everything back to 0 can cause issues with HA Statistics, I propose to set it only to 0 for sensors with unit "W".

codecov[bot] commented 2 years ago

Codecov Report

Merging #94 (eda593b) into master (b060f38) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #94   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          419       419           
=========================================
  Hits           419       419           
Impacted Files Coverage Δ
pysma/sensor.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 b060f38...eda593b. Read the comment docs.