mikey0000 / Mammotion-HA

Home Assistant integration for Luba lawn mower
117 stars 16 forks source link

Error with latest update (only if you configure discovered device) #27

Closed Extreme79 closed 1 month ago

Extreme79 commented 1 month ago

Hi! With the latest update something was broken in home assistant integration. I already had luba device configured through en esp32 proxy. This evening I updated mammotion-ha. Luba was discovered again (?) .. and trying to configure multiple errors was throwed:

mammotion_1 mammotion_2

After this, became impossibile to open integration dashboard, with the loader that spinned to infinity (until ou reboot). Checking the logs, I saw only this relevant trace:

Registratore: homeassistant.components.websocket_api.http.connection
Fonte: config_entries.py:494
Integrazione: Home Assistant WebSocket API (documentazione, problemi)
Prima occorrenza: 23:45:59 (4 occorrenze)
Ultima registrazione: 23:54:54

[140266504476928] Error handling message: Unknown error (unknown_error) Simone from 192.168.1.10 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36)
[140265697731936] Error handling message: Unknown error (unknown_error) Simone from 192.168.1.10 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36)
[140265701171856] Error handling message: Unknown error (unknown_error) Simone from 192.168.1.10 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/json.py", line 61, in json_encoder_default
    raise TypeError
TypeError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 28, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 488, in config_entries_get
    fragments = await _async_matching_config_entries_json_fragments(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 557, in _async_matching_config_entries_json_fragments
    return [entry.as_json_fragment for entry in entries]
            ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/functools.py", line 995, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 494, in as_json_fragment
    return json_fragment(json_bytes(json_repr))
                         ^^^^^^^^^^^^^^^^^^^^^
TypeError: Type is not JSON serializable: BLEDevice

Next to this I removed integration, Reinstalled it, repeated.. same errors. So, removed, reinstalled, rebooted and manually added device without using discovered one: in this case all went fine with the device properly configured.

mikey0000 commented 1 month ago

pull the integration again, should be fixed now.

jLynx commented 1 month ago

Closing as it should now be fixed. Please let us know if you are still having this issue and we can reopen