Closed MapleEve closed 6 months ago
This is the best way to get userid and user token
Thank you. I'll try to put that into the addon.
Thank you. I'll try to put that into the addon.
Yes, this will keep user token alive for a quite long time, rather than just 1 year
res_login = lifesmart_Login(param['username'],param['passwd'],param['appkey'])
if res_login['code'] == "error":
_LOGGER.error("login fail: %s",str(res_login['message']))
param['token'] = res_login['token']
param['userid'] = res_login['userid']
res_doauth = lifesmart_doAuth(param['userid'],param['token'],param['appkey'])
if res_doauth['code'] == "error":
_LOGGER.error("login fail: %s",str(res_doauth['message']))
param['usertoken'] = res_doauth['usertoken']
besides, the rgn can be a seletive input in HACS config, rather than a domain input.