Consumers that restore a session from a stored token (e.g. tplinkcloud-service) currently have to reach into private attributes because there's no public API for two things:
- Regional API host — discovered during
login() and needed to reconstruct a working manager from a stored token. Consumers read/write manager._kasa_api.host. Proposed: get_api_host() / set_api_host(host) (and the Tapo equivalents).
- Tapo token pair —
set_auth_token() sets only the Kasa token; there's no set_tapo_auth(), so consumers assign manager._tapo_token directly.
Adding these lets a stateless service restore a session through the library's contract instead of its internals, so a future refactor of those private names doesn't silently break downstream token restoration.
Context: raised in tplinkcloud-service#9 review. Not urgent — the consumer pins >=5.2.0,<6 and has a guard test asserting these internals exist — but the public surface is the right long-term fix.
Consumers that restore a session from a stored token (e.g. tplinkcloud-service) currently have to reach into private attributes because there's no public API for two things:
login()and needed to reconstruct a working manager from a stored token. Consumers read/writemanager._kasa_api.host. Proposed:get_api_host()/set_api_host(host)(and the Tapo equivalents).set_auth_token()sets only the Kasa token; there's noset_tapo_auth(), so consumers assignmanager._tapo_tokendirectly.Adding these lets a stateless service restore a session through the library's contract instead of its internals, so a future refactor of those private names doesn't silently break downstream token restoration.
Context: raised in tplinkcloud-service#9 review. Not urgent — the consumer pins
>=5.2.0,<6and has a guard test asserting these internals exist — but the public surface is the right long-term fix.