Katamave / sonnen_api_v2

Sonnenbatterie API v2 fetcher
MIT License
0 stars 2 forks source link

Add Metrics for Battery Backup management #2

Closed MarkusBiggus closed 2 months ago

MarkusBiggus commented 2 months ago

Change log:

Test parameters stored in .env file to remove dependency on O/S environment variables. example.env has values for existing tests, copy to .env before running test_sonnen

Refactored some API item names to follow a convention so to allow very similar names from different API endpoints to be less confusing

Changed some decorator types to match data being returned by API

Separate concerns: Removed date formatting from data fetch function (date formatted by caller) <- possible breaking change to existing code. Tests have this refactor for examples.

Added functions to return data related to backup buffer management

Added test_batterie to query live battery to display data relevant to backup buffer management

Changed mock data (looks more like live data) to get all tests working. Refactored some tests to not get data when testing API failures

All tests pass

MarkusBiggus commented 2 months ago

not ready yet.