mikey0000 / Mammotion-HA

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

Error when trying to setup integration from BT discovery #23

Closed zweckj closed 1 month ago

zweckj commented 1 month ago

Integration fails to setup with the following errors:

Exception in async_forward_config_entry_changes when dispatching 'config_entry_changed': (<ConfigEntryChange.ADDED: 'added'>, ) 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/config/config_entries.py", line 525, in async_forward_config_entry_changes "entry": entry.as_json_fragment, ^^^^^^^^^^^^^^^^^^^^^^ 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

Exception in async_forward_config_entry_changes when dispatching 'config_entry_changed': (<ConfigEntryChange.UPDATED: 'updated'>, ) 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/config/config_entries.py", line 525, in async_forward_config_entry_changes "entry": entry.as_json_fragment, ^^^^^^^^^^^^^^^^^^^^^^ 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

zweckj commented 1 month ago

By looking at it I'd say line 66 in config_flow is the problem. I'll see if I can find the time ti fix it later.