Closed trainman419 closed 5 years ago
My Leviton residence is shared with one of my roommates, and they're the primary account holder.
I was getting this error when trying to run the cli-test tool:
Permission: {'invitationId': XXXX, 'personId': 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', 'status': 'active', 'residentialAccountId': None, 'created': '2018-05-10T05:26:26.000Z', 'residenceId': XXXX, 'id': XXXX, 'access': 'admin', 'lastUpdated': None} myLeviton API call (/ResidentialAccounts/None/residences) failed: 401, {"error":{"statusCode":401,"name":"Error","message":"Authorization Required"}}
It looks like the residentialAccountId isn't populated for shared accounts, and residenceId is populated instead. This fix detects that scenario and creates the appropriate Residence object, which seems to work.
residentialAccountId
residenceId
Residence
My Leviton residence is shared with one of my roommates, and they're the primary account holder.
I was getting this error when trying to run the cli-test tool:
It looks like the
residentialAccountId
isn't populated for shared accounts, andresidenceId
is populated instead. This fix detects that scenario and creates the appropriateResidence
object, which seems to work.