Hoffmann77 / home_assistant_enphase_gateway

A custom integration for Home Assistant to read data from your Enphase Gateway.
Apache License 2.0
0 stars 0 forks source link

After initial 401 Error while trying to update token: 'EnphaseToken' object has no attribute 'update' #7

Closed catsmanac closed 1 year ago

catsmanac commented 1 year ago

4 is solved, this time I see missing attribute 'update'

Setup Enphase gateway
HTTP GET Attempt #1: https://192.168.3.112/production.json: Header:{'Authorization': 'Bearer <TOKEN'}
Received status_code 401 from Gateway
Request header: {'Authorization': 'Bearer <TOKEN>'}
Trying to update token
Error while trying to update token: 'EnphaseToken' object has no attribute 'update'
catsmanac commented 1 year ago

After HACS update and restart log changed to:

[custom_components.enphase_gateway.enphase_token] New Enphase owner Token valid until: 2024-07-02 20:28:23+00:00
[custom_components.enphase_gateway.gateway_reader.gateway_reader] Setup Enphase gateway
[custom_components.enphase_gateway.gateway_reader.gateway_reader] HTTP GET Attempt #1: https://192.168.3.112/production.json: Header:{'Authorization': 'Bearer <token>'}
[custom_components.enphase_gateway.gateway_reader.gateway_reader] Received status_code 401 from Gateway
[custom_components.enphase_gateway.gateway_reader.gateway_reader] Request header: {'Authorization': 'Bearer <token>'}
[custom_components.enphase_gateway.gateway_reader.gateway_reader] Trying to update token
[py.warnings] /config/custom_components/enphase_gateway/gateway_reader/gateway_reader.py:289: RuntimeWarning: coroutine 'EnphaseToken.update' was never awaited
  self._enphase_token.update()
Hoffmann77 commented 1 year ago

Silly mistake. Should be finally fixed now.