DarwinsBuddy / WienerNetzeSmartmeter

A home-assistant integration supporting WienerNetze Smartmeters as sensors
134 stars 14 forks source link

Check if historical data was returned #144

Closed reox closed 1 year ago

reox commented 1 year ago

resolves #143

There is just one question now: In this case, the historical data import will be triggered every time until there is any data. @DarwinsBuddy Should we write an empty statistics here to prevent the import the next time?

codecov[bot] commented 1 year ago

Codecov Report

Merging #144 (e2ea145) into main (7d43581) will decrease coverage by 0.15%. The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #144      +/-   ##
==========================================
- Coverage   30.09%   29.95%   -0.15%     
==========================================
  Files          12       12              
  Lines         618      621       +3     
  Branches       84       85       +1     
==========================================
  Hits          186      186              
- Misses        422      425       +3     
  Partials       10       10              
Impacted Files Coverage Δ
custom_components/wnsm/statistics_sensor.py 0.00% <0.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

DarwinsBuddy commented 1 year ago

Empty one might be the safe call. Only prerequisite for it should be that we definitely know that there is no data to import, and it's not a flaky response

reox commented 1 year ago

Only prerequisite for it should be that we definitely know that there is no data to import, and it's not a flaky response

I guess this is very hard to test... Or can we maybe query somehow when the smartmeter was activated? Then it would be relatively easy to decide if there is data to be expected.