mob41 / broadlink-java-api

A clean Broadlink API for Java
MIT License
22 stars 25 forks source link

[Patch] Read Power Consumption from SP2/SP3 devices #25

Open KiralyCraft opened 4 years ago

KiralyCraft commented 4 years ago

https://pastebin.com/kidagDLn

I'm too lazy to do this properly, here is a quick thing to add in the SP2Device class that allows reading of power consumption. Returns exactly the same values as in the app.

Also, for some reason, my SP2 plugs return this as their model: -27526 I had to add it manually in BLDevice to force it to create an instance of it. It's written "SP3" on my plugs but they work with SP2 api so who knows.

The patch above works for my specific plugs, SP3, european style connector: https://2.bp.blogspot.com/-idwScYkor94/WJWdYcM1LEI/AAAAAAAAFvE/MapfzRuCQX8Ift1eqLiDlrSnRo1modgLQCLcB/s1600/Broadlink-SP3.jpg