Closed lexterror closed 5 years ago
No, that is outside the scope of this project.
I have found that it's a bit easier on other platforms that have basic HTTP (like microcontrollers and stuff) to use the kasa protocol instead of hitting the bulbs directly with UDP packets. It works over the internet (not just your LAN where the bulbs are located) and would work better overall with android, I think.
If you want to write an android lib, check out kasa_control. It's also written in node, but uses simple HTTP requests, so it should be fairly trivial to port. Implement the kasa method then all the others should be pretty simple (send JSON, get JSON responses.)
You can use this lib as a reference for message formats (to use in your version of send) for messages that aren't built in kasa_control.
Your process will probably be similar to this:
kasa('login', { appType: 'Kasa_Android', cloudUserName, cloudPassword, terminalUUID: RANDOM_UUID4 })
kasa('getDeviceList')
kasa('passthrough', {deviceId, requestData: JSON.stringify(msg)})
You can find example msg
objects here.
I wanted to know whether you could build an android version.
Thank you.