elbowz / ha-homie

Homie integration for Home Assistant
GNU General Public License v3.0
11 stars 5 forks source link

Config UI is broken #14

Open spinza opened 1 year ago

spinza commented 1 year ago

Browsing to Settings/Devices & Integrations/Home and then clicking on CONFIGURE results in a error: image The following errors are shown on the console:

2023-08-18 23:50:32.588 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/home/louis/source/ha_core/venv/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/louis/source/ha_core/venv/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/louis/source/ha_core/venv/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/louis/source/ha_core/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/louis/source/ha_core/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/louis/source/ha_core/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/louis/source/ha_core/homeassistant/components/http/ban.py", line 80, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/louis/source/ha_core/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/louis/source/ha_core/homeassistant/components/http/headers.py", line 31, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/louis/source/ha_core/homeassistant/components/http/view.py", line 148, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/louis/source/ha_core/homeassistant/components/http/decorators.py", line 63, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/louis/source/ha_core/homeassistant/components/config/config_entries.py", line 216, in post
    return await super().post(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/louis/source/ha_core/homeassistant/components/http/data_validator.py", line 72, in wrapper
    result = await method(view, request, data, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/louis/source/ha_core/homeassistant/helpers/data_entry_flow.py", line 85, in post
    result = self._prepare_result_json(result)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/louis/source/ha_core/homeassistant/helpers/data_entry_flow.py", line 44, in _prepare_result_json
    data["data_schema"] = voluptuous_serialize.convert(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/louis/source/ha_core/venv/lib/python3.11/site-packages/voluptuous_serialize/__init__.py", line 40, in convert
    pval = convert(value, custom_serializer=custom_serializer)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/louis/source/ha_core/venv/lib/python3.11/site-packages/voluptuous_serialize/__init__.py", line 120, in convert
    if issubclass(schema, Enum):
       ^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: issubclass() arg 1 must be a class
RAY8180 commented 1 year ago

CONF_QOS is the issue in the UI it uses mqtt.valid_qos_schema as type but this is later not handled by the config validator. An option is to change this to cv.string and later convert it to a int value or enable the config validator to handle mqtt.valid_qos_schema.