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

Added SocketDevice #167

Merged
merged 2 commits into from
Aug 10, 2022
Merged

Added SocketDevice #167

merged 2 commits into from
Aug 10, 2022

Conversation

Felix-Pi
Copy link
Contributor

@Felix-Pi Felix-Pi commented Aug 9, 2022

Added SocketDevice to receive power consumption data

@jasonacox jasonacox merged commit cfc4aa7 into jasonacox:master Aug 10, 2022
@jasonacox
Copy link
Owner

Brilliant! Thanks @Felix-Pi ! Great work on the extension.

I merged this but suggest you consider adding a few things:

  • There are 3.1 and 3.3 devices that use DPS 4, 5 and 6 for current, power and voltage (see here). I have some of these. You could add some basic logic to check for DPS 18 and if it isn't there, use 4, 5 and 6.
  • Error handling for non-energy plugs - If a device does not show up with the needed DPS values, instead of allowing a KeyError exception, catch it and respond back with an error indicating the device does not appear to have energy measurement (see the error_json() function if you want to use it for a response).

@Felix-Pi
Copy link
Contributor Author

Thank you for your input! I'll look into it as soon as possible 👍🏼

@jasonacox
Copy link
Owner

@Felix-Pi your code is now live in v1.6.6..

Thanks again for your help!

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.

2 participants