dotKrad / hass-fpl

FPL Component for Home Assistant
MIT License
40 stars 20 forks source link

Recent Update Broke Integration in HACS #31

Open adam-olson opened 2 years ago

adam-olson commented 2 years ago

Version of the custom_component

7baac81

Describe the bug

Opened an issue with HACS on the bug but he said to open one with you as it appears to have been caused by changes in the recent update to files. See github issue, https://github.com/hacs/integration/issues/2796

Debug log


2022-07-18 11:40:25 DEBUG (MainThread) [custom_components.hacs] <Integration dotKrad/hass-fpl> Getting repository information
2022-07-18 11:40:25 DEBUG (MainThread) [custom_components.hacs] <Integration dotKrad/hass-fpl> Running checks against master
2022-07-18 11:40:26 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140668858855536] Error handling message: Unknown error (unknown_error)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
    await func(hass, connection, msg)
  File "/config/custom_components/hacs/websocket/repository.py", line 40, in hacs_repository_info
    await repository.update_repository(ignore_issues=True, force=True)
  File "/config/custom_components/hacs/utils/decorator.py", line 28, in wrapper
    result = await function(*args, **kwargs)
  File "/config/custom_components/hacs/repositories/integration.py", line 110, in update_repository
    if manifest := await self.async_get_integration_manifest():
  File "/config/custom_components/hacs/repositories/integration.py", line 166, in async_get_integration_manifest
    return json_loads(decode_content(response.data.content))
orjson.JSONDecodeError: key must be a string at line 14 column 1: line 14 column 1 (char 260)
dorgan commented 2 years ago

Same here looks like a bad merge inside of config/custom_components/fpl/sensor_KWHSensor.py

image

adam-olson commented 2 years ago

It is not just that file, it is almost all of the .py files, have the corrupted sections in them.

Lukejb14 commented 2 years ago

✅ Resolved.

Update to newest FPL release in HACS to resolve this issue.

subcritical71 commented 2 years ago

I updated my FPL add on to the latest. In doing so I ran into some issues and removed the add on, reinstalled the latest code, then tried to add the integration. I get the login/password prompt but cannot get past it due to an error;

2022-08-05 15:06:37.174 INFO (MainThread) [custom_components.fpl] Logging in
2022-08-05 15:06:42.176 ERROR (MainThread) [custom_components.fpl] Error : <class 'asyncio.exceptions.TimeoutError'>

Is this related to this issue or should I go ahead a make a new issue? I cannot seems to find where I am going wrong.

subcritical71 commented 2 years ago

I should add that when I get this error I do not get my normal email from FPL telling me someone tried to access my account.

adamoutler commented 2 years ago

Still broken for months now.

dotKrad commented 2 years ago

try to remove it and add again, and let me know pls

On Sun, Aug 28, 2022 at 11:52 AM Adam Outler @.***> wrote:

Still broken for months now.

— Reply to this email directly, view it on GitHub https://github.com/dotKrad/hass-fpl/issues/31#issuecomment-1229491891, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD6TTASZ6Y5YLOWLFPHAYNDV3ODNTANCNFSM5344BSVA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

adamoutler commented 2 years ago

I removed and readded. It came online after 2 hours. I suppose this issue could be closed, but it does need some work. On a side note the devcontainer appears to be broken as well.

Lukejb14 commented 2 years ago

try to remove it and add again, and let me know pls

On Sun, Aug 28, 2022 at 11:52 AM Adam Outler @.***> wrote:

Still broken for months now.

— Reply to this email directly, view it on GitHub https://github.com/dotKrad/hass-fpl/issues/31#issuecomment-1229491891, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD6TTASZ6Y5YLOWLFPHAYNDV3ODNTANCNFSM5344BSVA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

This worked, FPL entities online immediately.

Steps that worked for me: • Remove FPL integration • Remove FPL from HACS • Restart • Install FPL from HACS • Restart • Setup FPL integration

dorgan commented 2 years ago

Removing and re-adding works, but having to do this every couple months is nuts.

On Mon, Aug 29, 2022, 9:20 AM Lukejb14 @.***> wrote:

try to remove it and add again, and let me know pls

On Sun, Aug 28, 2022 at 11:52 AM Adam Outler @.***> wrote:

Still broken for months now.

— Reply to this email directly, view it on GitHub

31 (comment)

https://github.com/dotKrad/hass-fpl/issues/31#issuecomment-1229491891, or unsubscribe

https://github.com/notifications/unsubscribe-auth/AD6TTASZ6Y5YLOWLFPHAYNDV3ODNTANCNFSM5344BSVA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

This worked, FPL entities online immediately.

Steps that worked for me: • Remove FPL integration • Remove FPL from HACS • Restart • Install FPL from HACS • Restart • Setup FPL integration

— Reply to this email directly, view it on GitHub https://github.com/dotKrad/hass-fpl/issues/31#issuecomment-1230293007, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADRPU2BZUJ7SVVUWQD7LZTV3S2IFANCNFSM5344BSVA . You are receiving this because you commented.Message ID: @.***>

adamoutler commented 2 years ago

In the event the data isn't there, when in __init__.py, in the method async_setup_entry, you can raise ConfigEntryNotReady to cause HA to call async_setup_entry again at a later time. This may be what is required.

adamoutler commented 2 years ago

Mine are back offline. It needs to be debounced. Like if the data is empty, don't replace the data source. It needs to use the last known good value.

While I was typing this, the sensors all came back online.