WLED: HA Service call to WLED entities works but generates KeyError: 'b'

What happened?

I’ve recently upgraded from 0.13.1-b6, since then after each HA service call to a WLED entity (i.e. turning off the master, selecting presets) I’m getting a get a toast notification with an error in the HA GUI and a new entry in the error log, the action however completes successfully.

This stops HA scripts from completing causing issues in automations.

To Reproduce Bug

Example service call:

service: select.select_option
data:
  option: Rainbow
target:
  entity_id: select.wled_left_preset

Expected Behavior

Not generate an error…

Install Method

Self-Compiled

What version of WLED?

WLED 0.13.2-a0 (build 2203191)

Which microcontroller/board are you seeing the problem on?

ESP32

Relevant log/trace output

Calling homeassistant.turn_off on wled_master:

Logger: homeassistant.helpers.script.websocket_api_script
Source: components/wled/button.py:78
First occurred: 08:14:32 (1 occurrences)
Last logged: 08:14:32

websocket_api script: Error executing script. Unexpected error for call_service at pos 1: 'b'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 367, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 570, in _async_call_service_step
    await service_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1636, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1673, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/components/homeassistant/__init__.py", line 122, in async_handle_turn_service
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/core.py", line 1636, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1673, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await self.hass.helpers.service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 671, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 949, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 708, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 513, in async_handle_light_off_service
    await light.async_turn_off(**filter_turn_off_params(light, params))
  File "/usr/src/homeassistant/homeassistant/components/wled/helpers.py", line 18, in handler
    self.coordinator.update_listeners()
  File "/usr/src/homeassistant/homeassistant/components/wled/coordinator.py", line 60, in update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 325, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 553, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 590, in _async_write_ha_state
    state = self._stringify_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 557, in _stringify_state
    if not self.available:
  File "/usr/src/homeassistant/homeassistant/components/wled/button.py", line 78, in available
    and beta > current
  File "/usr/local/lib/python3.9/site-packages/awesomeversion/awesomeversion.py", line 164, in __gt__
    return self.string != compareto.string and self._compare_versions(
  File "/usr/local/lib/python3.9/site-packages/awesomeversion/awesomeversion.py", line 201, in _compare_versions
    result = handler(AwesomeVersion(version_a), AwesomeVersion(version_b))
  File "/usr/local/lib/python3.9/site-packages/awesomeversion/comparehandlers/modifier.py", line 28, in compare_handler_semver_modifier
    SEMVER_MODIFIER_MAP[version_a.modifier_type]
KeyError: 'b'

Anything else?

Self-compliled with -D USERMOD_MULTI_RELAY HA 2022.3.8 (same issue in 2022.4.0b3) Deleting/adding the WLED integration makes no difference

Code of Conduct

  • I agree to follow this project’s Code of Conduct

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 22 (2 by maintainers)

Most upvoted comments

I still do not get it @frenck, why do you insist WLED is not following SemVer or the standards as defined by Wikipedia?

This is clearly not a WLED issue.

Hey no reason to be insulting.

It wasn’t meant insulting, there is no nicer way to put it 🤷 The fact is that there are many versioning schemes out there. Like it or not.