Skip to content

UniFi Protect lux mapping out of range #122408

Closed
@vash2695

Description

The problem

Getting this error every 10 seconds:

2024-07-22 12:08:34.076 ERROR (MainThread) [uiprotect.api] Exception while running subscription handler
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/uiprotect/api.py", line 860, in emit_message
sub(msg)
File "/usr/src/homeassistant/homeassistant/components/unifiprotect/data.py", line 296, in _async_process_ws_message
self._async_update_device(new_obj, message.changed_data)
File "/usr/src/homeassistant/homeassistant/components/unifiprotect/data.py", line 233, in _async_update_device
self._async_signal_device_update(device)
File "/usr/src/homeassistant/homeassistant/components/unifiprotect/data.py", line 340, in _async_signal_device_update
update_callback(device)
File "/usr/src/homeassistant/homeassistant/components/unifiprotect/entity.py", line 238, in _async_updated_event
self._async_update_device_from_protect(device)
File "/usr/src/homeassistant/homeassistant/components/unifiprotect/number.py", line 273, in _async_update_device_from_protect
self._attr_native_value = self.entity_description.get_ufp_value(self.device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/uiprotect/utils.py", line 651, in get_top_level_attr
value = getattr(obj, attr)
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/uiprotect/data/devices.py", line 1130, in icr_lux_display
return LUX_MAPPING_VALUES[10 - self.isp_settings.icr_custom_value]
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range

What version of Home Assistant Core has the issue?

core-2024.7.3

What was the last working version of Home Assistant Core?

core-2024.7.2

What type of installation are you running?

Home Assistant OS

Integration causing the issue

unifiprotect

Link to integration documentation on our website

https://www.home-assistant.io/integrations/unifiprotect

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions