-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suez water: fetch historical data in statistics #131166
base: dev
Are you sure you want to change the base?
Conversation
Hey there @ooii, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
c9e0e6d
to
eabd939
Compare
eabd939
to
58d5f8d
Compare
58d5f8d
to
5f3206c
Compare
with ( | ||
patch("homeassistant.components.suez_water.PLATFORMS", [Platform.SENSOR]), | ||
patch( | ||
"homeassistant.components.suez_water.coordinator.SuezWaterCoordinator._update_statistics", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we patch this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did it so each platform is tested indepently from each other but beaucse the statistics did not belong to any platform I did not find another way of doing it.
But I removed this patch anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should rather go in test_init
as we have tests per platform and we don't want to assume you are using a coordinator
_sum = 0 | ||
for _k, stat in enumerate(stats[statistic_id]): | ||
value = 500 | ||
if statistic == "water_cost_statistics": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not have if statements in tests though
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Proposed change
Fetch all historical provided by suez into statistics.
Suez water provide historical daily data of water consumption, these changes fetch all the available data and insert it into statistics to make it available in energy dashboard.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: