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 on HA startup #1487

Closed
vampywiz17 opened this issue Jan 7, 2024 · 6 comments
Closed

Error on HA startup #1487

vampywiz17 opened this issue Jan 7, 2024 · 6 comments

Comments

@vampywiz17
Copy link
Contributor

vampywiz17 commented Jan 7, 2024

I get this when HA start. The devices are working propertly.

2024-01-07 17:00:24.492 ERROR (MainThread) [homeassistant.components.select] Error while setting up tuya_local platform for select
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 360, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/tuya_local/select.py", line 14, in async_setup_entry
    await async_tuya_setup_platform(
  File "/config/custom_components/tuya_local/helpers/config.py", line 34, in async_tuya_setup_platform
    data[ecfg.config_id] = entity_class(device, ecfg)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tuya_local/select.py", line 39, in __init__
    raise AttributeError(
AttributeError: select_initial_state does not have a mapping to a list of options
@vampywiz17 vampywiz17 added the bug Something isn't working label Jan 7, 2024
@make-all make-all added awaiting feedback Needs more information device improvement Improvement to an existing device config and removed bug Something isn't working labels Jan 7, 2024
@make-all
Copy link
Owner

make-all commented Jan 7, 2024

What device is this for (the name of the config file you selected)?

@vampywiz17
Copy link
Contributor Author

@make-all general error, in home-assistant.log

@make-all
Copy link
Owner

make-all commented Jan 7, 2024

It is not a general error, as it is not occuring on my installation. It is an error parsing one of the 500+ config files, and I need to know which one it is to fix the issue.

@vampywiz17
Copy link
Contributor Author

vampywiz17 commented Jan 7, 2024

@make-all

It help you?

2024-01-08 00:43:47.374 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Loaded device config somgom_single_switch.yaml
2024-01-08 00:43:47.374 DEBUG (MainThread) [custom_components.tuya_local.helpers.config] Adding number for number_timer
2024-01-08 00:43:47.375 ERROR (MainThread) [homeassistant.components.select] Error while setting up tuya_local platform for select
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 360, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/tuya_local/select.py", line 14, in async_setup_entry
    await async_tuya_setup_platform(
  File "/config/custom_components/tuya_local/helpers/config.py", line 34, in async_tuya_setup_platform
    data[ecfg.config_id] = entity_class(device, ecfg)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tuya_local/select.py", line 39, in __init__
    raise AttributeError(
AttributeError: select_initial_state does not have a mapping to a list of options
2024-01-08 00:43:47.389 WARNING (MainThread) [homeassistant.components.light] Entity None (<class 'custom_components.tuya_local.light.TuyaLocalLight'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <LightEntityFeature: 0> and color modes, please create a bug report at https://github.com/make-all/tuya-local/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation
2024-01-08 00:43:47.391 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of value
2024-01-08 00:43:47.391 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of value
2024-01-08 00:43:47.391 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for step of value
2024-01-08 00:43:47.391 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Step for value is 1 with scale 60
2024-01-08 00:43:47.391 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of value
2024-01-08 00:43:47.391 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of value
2024-01-08 00:43:47.391 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for step of value
2024-01-08 00:43:47.391 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Step for value is 1 with scale 60
2024-01-08 00:43:47.392 DEBUG (MainThread) [custom_components.tuya_local.device] Refreshing device state for Wall switch

@vampywiz17
Copy link
Contributor Author

vampywiz17 commented Jan 7, 2024

Hmm i remember... this is device the problem:

#962

make-all added a commit that referenced this issue Jan 8, 2024
When we get exceptions during entity creation, the exception was being
thrown to HA to handle. But this loses some of the info such as which
config file the error is in, and will also prevent other entities using
the same platform from being enabled.

Catch the exception to prevent other entities from being affected, and print
a useful error message. There is already a separate exception thrown if
no entities are available to set up for the platform, so that will still be
thrown if there are no other entities that would have been blocked by an
exception being thrown during initialisation.

Issue #1487
make-all added a commit that referenced this issue Jan 8, 2024
Initial state dp is optional, but there was no listing for the null case.
List the options so that the select entity is created correctly.

Issue #1487
@make-all make-all added awaiting confirmation Wating for confirmation the issue is solved unreleased Will be in next release and removed awaiting feedback Needs more information labels Jan 8, 2024
@vampywiz17
Copy link
Contributor Author

I change somgom swith config and now the error is gone AND the last state field work well! Thanks a lot!!

@make-all make-all removed the awaiting confirmation Wating for confirmation the issue is solved label Jan 8, 2024
@make-all make-all reopened this Jan 8, 2024
@make-all make-all removed unreleased Will be in next release device improvement Improvement to an existing device config labels Jan 8, 2024
@make-all make-all closed this as completed Jan 8, 2024
timlaing pushed a commit to timlaing/tuya-local that referenced this issue Aug 8, 2024
When we get exceptions during entity creation, the exception was being
thrown to HA to handle. But this loses some of the info such as which
config file the error is in, and will also prevent other entities using
the same platform from being enabled.

Catch the exception to prevent other entities from being affected, and print
a useful error message. There is already a separate exception thrown if
no entities are available to set up for the platform, so that will still be
thrown if there are no other entities that would have been blocked by an
exception being thrown during initialisation.

Issue make-all#1487
timlaing pushed a commit to timlaing/tuya-local that referenced this issue Aug 8, 2024
Initial state dp is optional, but there was no listing for the null case.
List the options so that the select entity is created correctly.

Issue make-all#1487
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants