dickydoouk / tp-link-tapo-connect

Unofficial Node.js library for connecting to TP-Link Tapo devices. Currently limited to the P100 & P105 smart plugs and L510E smart bulbs.
112 stars 39 forks source link

Support for Light bulb L530E? #6

Closed SrZorro closed 3 years ago

SrZorro commented 3 years ago

There is any plans about implementing the L530E? I have that light bulb, If I could have some pointers about the API and whatnot I could try to do a pull request for it.

dickydoouk commented 3 years ago

I don't have that light bulb but I would image on/off/dim functionality should work. Not sure about colour/hue setting as I am unclear the property name. Can you confirm if the API can turn the bulb on/off. You can use the api.test.js file and put your credentials in at the top and rename one of the xtest functions to test then run npm test. Would be useful if you could paste here the result of the getDeviceInfo result. Thanks

SrZorro commented 3 years ago

Perfect, tomorrow I will do that and come back with the results 👍

Edit: Tomorrow will be this weekend, sorry for the delay

SrZorro commented 3 years ago

Perfect, all methods are working.

getDeviceInfo


{
   "device_id":"<device id>",
   "fw_ver":"1.1.8 Build 20201210 Rel. 55943",
   "hw_ver":"1.0.0",
   "type":"SMART.TAPOBULB",
   "model":"L530 Series",
   "mac":"<mac addres>",
   "hw_id":"<hw_id>",
   "fw_id":"<fw_id>",
   "oem_id":"<oem_id>",
   "specs":"EU",
   "lang":"es_ES",
   "device_on":true,
   "on_time":711,
   "overheated":false,
   "nickname":"bedroom",
   "avatar":"floor_lamp_1",
   "brightness":10,
   "dynamic_light_effect_enable":false,
   "color_temp":6000,
   "default_states":{
      "type":"last_states",
      "state":{
         "brightness":10,
         "color_temp":6000
      }
   },
   "time_diff":60,
   "region":"Europe/Madrid",
   "longitude":"<longitude int>",
   "latitude":"<latitude int>",
   "has_set_location_info":true,
   "ip":"<local id>",
   "ssid":"<ssid>",
   "signal_level":3,
   "rssi":-37
}```
dickydoouk commented 3 years ago

Thats excellent, thanks for doing that. I'm glad it works.

Looks like the property name for the colour is color_temp so will leave this ticket open till we add that property.

SrZorro commented 3 years ago

There should be more properties, I will change the settings from the app and document all the actions, because I don't see an option for the hsl value

dewhurstwill commented 3 years ago

I have written a colour conversion & api helper, feel free to review and merge. PR #7 @dickydoouk

dickydoouk commented 3 years ago

Closing this issue as PR working