wlcrs / huawei_solar

Home Assistant integration for Huawei Solar inverters via Modbus
GNU Affero General Public License v3.0
559 stars 89 forks source link

[Bug]: #510

Closed macrojames closed 1 year ago

macrojames commented 1 year ago

Describe the issue

After enabling another entity, HA tries to reload the integration and fails on unloading the services.

I think it is just a ) too far to the right.

Bescribe your Huawei Solar Setup

Inverter Type: SUN2000-10KTL-M1 Inverter Firmware version: SDongle present: yes Power meter present: three phase Battery: LUNA2000 5kWh Battery Firmware version:

How do you connect to the inverter?

Via the SUN2000-<serial_no> WiFi

Upload your Diagnostics File

Impossible after the bug hit

Upload your relevant debug logs

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 543, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/huawei_solar/__init__.py", line 218, in async_unload_entry
    await async_cleanup_services(hass)
  File "/config/custom_components/huawei_solar/services.py", line 680, in async_cleanup_services
    if len(hass.data[DOMAIN] == 1):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: object of type 'bool' has no len()

Please confirm the following:

macrojames commented 1 year ago

Seems already fixed in #482, I didn't search the correct terms.