Skip to content
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

adding energy sensor for plugs #460

Merged
merged 3 commits into from
Oct 15, 2023

Conversation

benoitm974
Copy link
Contributor

Since homeassistant deprecated the energy and power in switch entity, moving energy as sensor.

@adicrescenzo
Copy link

Please @albertogeniola merge this pull request in order to restore the energy and power data

Copy link
Owner

@albertogeniola albertogeniola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @benoitm974 for the PR.

In general I think it is going through the right direction, but there are some changes (imho) that should be performed before merging. Let mw know what you think about those.

@adicrescenzo : let's wait for @benoitm974 to apply the requested changes. Once applied, I'll test it and merge in dev/main, releasing the next version.

custom_components/meross_cloud/sensor.py Outdated Show resolved Hide resolved
custom_components/meross_cloud/sensor.py Outdated Show resolved Hide resolved
custom_components/meross_cloud/sensor.py Outdated Show resolved Hide resolved
Taking @albertogeniola requests for pull-request merge
@benoitm974
Copy link
Contributor Author

Original intent was to add energy sensor as part of switch I didn't though there would be energy sensor not being electricity devices ... I've included the changes mentioned. Thanks for your feedback.

@benoitm974
Copy link
Contributor Author

By th way I was not able to conclude whether you’d remove the previous code from the switch file since it was depreciated in home assistant. I’m not familiar enough with home assistant code practice for this.

@albertogeniola
Copy link
Owner

By th way I was not able to conclude whether you’d remove the previous code from the switch file since it was depreciated in home assistant. I’m not familiar enough with home assistant code practice for this.

Since it has been deprecated, I think it is ok to get rid of them on the switch entity. However this will possibly break things for people who use them. For now, let's start by merging your work. I suggest to propose a new PR for getting rid of the deprecated properties.

@albertogeniola albertogeniola merged commit 2458a48 into albertogeniola:development Oct 15, 2023
1 check passed
@benoitm974
Copy link
Contributor Author

By th way I was not able to conclude whether you’d remove the previous code from the switch file since it was depreciated in home assistant. I’m not familiar enough with home assistant code practice for this.

Since it has been deprecated, I think it is ok to get rid of them on the switch entity. However this will possibly break things for people who use them. For now, let's start by merging your work. I suggest to propose a new PR for getting rid of the deprecated properties.

Is there a version mecanism in home assistant where we could test the version and not execute the code ? I was not able to identify if home assistant simply don't call those anymore in newer version or still call it but it gets ignore or fails... therefore we could had a if version > then.

@benoitm974
Copy link
Contributor Author

@albertogeniola can we close both issue #404 and #439 ? Thanks a lot for integration in 1.2.10!

@albertogeniola
Copy link
Owner

Done! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants