Closed lyricnz closed 6 months ago
Looks like a PATCH to the client URL
{"name":"smartplug6","rateLimit":{"enable":false},"clientLockToApSetting":{"enable":false},"ipSetting":{"useFixedAddr":false}}
OK, found the API docs from https://community.tp-link.com/en/business/forum/topic/590430
And submitted the patch. Worked fine.
payload = {
"name": f'WAS {x.name}',
# "rateLimit": {
# "enable": False
# },
"clientLockToApSetting": {
"enable": False,
},
"ipSetting": {
"useFixedAddr": False
}
}
result = await site_client._api.request(
"patch",
site_client._api.format_url(f"clients/{x.mac}", site_client._site_id),
payload=payload,
)
FWIW the reason I ask is that the default "name" field appears to be mostly useless, and that's what's used on the map. I'd like to set each device to the name from the reverse-dns for the IP. The controller already has most of the hostnames in a different column...
Yeah, I haven't added any parts of the clients api yet. When I do this, I will be sure to include this feature. Or, if you want to submit a PR... :)
It would be useful if there was a method to set the name/username for a device. Then we can use either a static list, or arp (!), to push human-readable names into the controller.