-
Notifications
You must be signed in to change notification settings - Fork 13
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
New method fetch_metric_data() -> MetricData #61
Conversation
@slovdahl, take a look. I think, you want to use this new method. That will reduce amount of data reads required to populate entities with values.
|
Cool! I never took a good look at how the library works under the hood 😀 Does calling the old |
Yes |
I think I got it to work in HA. But I have so little experience with Python's unit testing and mocking that I cannot figure out how to get the tests to work 🙈 Pushed the current state here: https://github.com/slovdahl/core/commits/bump-vallox-websocket-api-to-4.2.0/ |
Will take a look tomorrow. |
@slovdahl I took a look. It was tough. Here is the result: home-assistant/core#110752 |
The plan is to replace all
fetch_metric
calls withfetch_metric_data
that will return newMetricData
class instance.MetricData
class works the same way as dictionary returned byfetch_metric
, but it has useful additional properties and functions. SeeMetricData
class source code for details.