Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handling request #1375

Closed
4 tasks done
oven-lab opened this issue May 1, 2023 · 6 comments
Closed
4 tasks done

Error handling request #1375

oven-lab opened this issue May 1, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@oven-lab
Copy link

oven-lab commented May 1, 2023

The problem

Editing a device via the config flow in home assistant returns an unknown error.

Environment

  • Localtuya version: V5.1.0
  • Home Assistant Core version: Home Assistant 2023.5.0b5 on Operating System 10.1 Info -->
  • Does the device work using the Home Assistant Tuya Cloud component ?
  • Does the device work using the Tinytuya (https://github.com/jasonacox/tinytuya) command line tool ?
  • Was the device working with earlier versions of localtuya ? Which one?
  • Are you using the Tuya/SmartLife App in parallel ?

Steps to reproduce

  1. Enter the localtuya configuration menu
  2. Click edit a device
  3. Choose the device (In my case a vacuum cleaner)
  4. Press save to enter the DP menu
  5. Enter dataponts for clean time and fan speed (I have tried many)
  6. Press save

Provide Home Assistant traceback/logs

Impossible to enable debugging for any device.

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 227, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 235, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 146, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 241, in post
    return await super().post(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
    result = await method(view, request, data, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 271, in async_configure
    result = await self._async_handle_step(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/config/custom_components/localtuya/config_flow.py", line 743, in async_step_configure_entity
    ent_reg = await er.async_get_registry(self.hass)
AttributeError: module 'homeassistant.helpers.entity_registry' has no attribute 'async_get_registry'

Additional information

This is on home assistant beta, which might be causing problems. As far as i can see is "async_get_registry" depracated.
I would be greateful ta any help solving this problem

@oven-lab oven-lab added the bug Something isn't working label May 1, 2023
@Natclanwy
Copy link

I'm having this issue as well. Redeployed my network with new subnets and cannot update the IP addresses.

@sftgunner
Copy link

sftgunner commented May 7, 2023

Just want to +1 this issue - also experiencing the same error (on 2023.5.2, HASS OS 10.1, Supervisor 2023.04.1)

@sftgunner
Copy link

As @oven-lab has identified, it looks like this error is because async_get_registry has been removed in 2023.5 onwards. I've made a small pull request in #1381 that fixes this issue.

@oven-lab
Copy link
Author

oven-lab commented May 7, 2023

Pull request by @sftgunner works like a charm!

@rldaugherty
Copy link

I wanna +1 this issue as well. It seems that the devices are staying disconnected after the update.

@rospogrigio
Copy link
Owner

rospogrigio commented May 24, 2023

Fixed by PR #1400, in v.5.1.0 .

rospogrigio added a commit that referenced this issue May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants