Ekman / home-assistant-pure-i9

Electrolux Pure i9 robot vacuum integration for Home Assistant.
MIT License
26 stars 5 forks source link

Broken after upgrade to 2023.9.0 #49

Closed techillin closed 1 year ago

techillin commented 1 year ago

Upgraded from 2023.8.4

purei9: Not adding entity with invalid device info: Invalid device info {'default_model': 'Pure i9', 'identifiers': {('purei9', 'xxxxxxxxxx')}, 'manufacturer': 'Electrolux', 'name': 'Electrolux PI92', 'sw_version': '43.23'} for 'purei9' config entry: device info needs to either describe a device, link to existing device or provide extra information.

blavak68 commented 1 year ago

i am in the same situation in version 2023.8.4 was "only" warning, in version 2023.9.0 it's already error - broken

purei9: Not adding entity with invalid device info: Invalid device info {'default_model': 'Pure i9', 'identifiers': {('purei9', 'xxxxxxxxxxxxx')}, 'manufacturer': 'Electrolux', 'name': 'baam robot I', 'sw_version': '43.23'} for 'purei9' config entry: device info needs to either describe a device, link to existing device or provide extra information.

Romain13700 commented 1 year ago

Hello ! thanks for this integration !!! but i am in the same situation. updating to 2023.9.0 and not working :( thanks !!

Ekman commented 1 year ago

Thanks for reporting this! I'll look into it and get back when I have more information.

Romain13700 commented 1 year ago

Great, thank you ! and if we want to suggest new functions (not necessarily now but maybe later) can we do it here? I was thinking of adding the application's favorites so that it only works in the rooms you want

Ekman commented 1 year ago

Great, thank you ! and if we want to suggest new functions (not necessarily now but maybe later) can we do it here? I was thinking of adding the application's favorites so that it only works in the rooms you want

It's best to create a new issue (top right). Else, it risks getting lost when I resolve this one. 🙂

Romain13700 commented 1 year ago

ok ! thank you

juulius commented 1 year ago

found the problem.

Device info is indeed the culprit. this code in homeasistant is doing it.

for possible_type, allowed_keys in DEVICE_INFO_TYPES.items():
        if keys <= allowed_keys:
            device_info_type = possible_type
            break

    if device_info_type is None:
        raise DeviceInfoError(
            config_entry.domain,
            device_info,
            (
                "device info needs to either describe a device, "
                "link to existing device or provide extra information."
            ),
        )

    return device_info_type

its using this list to check if item is something that is in the DEVICE_INFO list

DEVICE_INFO_TYPES = {
    # Device info is categorized by finding the first device info type which has all
    # the keys of the device info. The link device info type must be kept first
    # to make it preferred over primary.
    "link": {
        "connections",
        "identifiers",
    },
    "primary": {
        "configuration_url",
        "connections",
        "entry_type",
        "hw_version",
        "identifiers",
        "manufacturer",
        "model",
        "name",
        "suggested_area",
        "sw_version",
        "via_device",
    },
    "secondary": {
        "connections",
        "default_manufacturer",
        "default_model",
        "default_name",
        # Used by Fritz
        "via_device",
    },
}

somehow the default_model is not accepted and throwing the exception so by changing in custom_components -> pureI9 in vacuum.py line 255 "default_model" to "model" in purei9.py line 165 "default_model" to "model" it works again after a restart

blavak68 commented 1 year ago

found the problem. . . . . . . . somehow the default_model is not accepted and throwing the exception so by changing in custom_components -> pureI9 in vacuum.py line 255 "default_model" to "model" in purei9.py line 165 "default_model" to "model" it works again after a restart

thx, your fix works

techillin commented 1 year ago

found the problem.

Device info is indeed the culprit. this code in homeasistant is doing it.

for possible_type, allowed_keys in DEVICE_INFO_TYPES.items():
       if keys <= allowed_keys:
           device_info_type = possible_type
           break

   if device_info_type is None:
       raise DeviceInfoError(
           config_entry.domain,
           device_info,
           (
               "device info needs to either describe a device, "
               "link to existing device or provide extra information."
           ),
       )

   return device_info_type

its using this list to check if item is something that is in the DEVICE_INFO list

DEVICE_INFO_TYPES = {
    # Device info is categorized by finding the first device info type which has all
    # the keys of the device info. The link device info type must be kept first
    # to make it preferred over primary.
    "link": {
        "connections",
        "identifiers",
    },
    "primary": {
        "configuration_url",
        "connections",
        "entry_type",
        "hw_version",
        "identifiers",
        "manufacturer",
        "model",
        "name",
        "suggested_area",
        "sw_version",
        "via_device",
    },
    "secondary": {
        "connections",
        "default_manufacturer",
        "default_model",
        "default_name",
        # Used by Fritz
        "via_device",
    },
}

somehow the default_model is not accepted and throwing the exception so by changing in custom_components -> pureI9 in vacuum.py line 255 "default_model" to "model" in purei9.py line 165 "default_model" to "model" it works again after a restart

Looks to be working after a quick test.

Ekman commented 1 year ago

I appreciate the investigation!

If you'd like, you can send a PR with the changes and I'll merge it. Otherwise, I'll look into this next weekend. 🙂

Romain13700 commented 1 year ago

Hello everyone thank you very much for this feedback! I made the modification directly on the files and it works again. that’s great thank you!

Ekman commented 1 year ago

I have released version 1.4.2 which contains the fix. Thank you @juulius.