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

Light core attempts to iterate None supported_color_modes #55451

Closed
brianegge opened this issue Aug 30, 2021 · 2 comments
Closed

Light core attempts to iterate None supported_color_modes #55451

brianegge opened this issue Aug 30, 2021 · 2 comments

Comments

@brianegge
Copy link
Contributor

The problem

The SmartThings light does not provide supported_color_modes (yet).

  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/service.py", line 695, in _handle_entity_call
    await result
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/light/__init__.py", line 448, in async_handle_light_on_service
    if ATTR_WHITE in params and COLOR_MODE_WHITE in supported_color_modes:
TypeError: argument of type 'NoneType' is not iterable

The code does not guard against supported_color_modes being None

What is version of Home Assistant Core has the issue?

2021.8.6

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Core

Integration causing the issue

Core+SmartThings

Link to integration documentation on our website

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

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2021-08-30 07:14:09 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140484098453568] Error handling message: Unknown error
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/websocket_api/decorators.py", line 25, in _handle_async_response
    await func(hass, connection, msg)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/websocket_api/commands.py", line 525, in handle_execute_script
    await script_obj.async_run(msg.get("variables"), context=context)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/script.py", line 1219, in async_run
    await asyncio.shield(run.async_run())
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/script.py", line 353, in async_run
    await self._async_step(log_exceptions=False)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/script.py", line 371, in _async_step
    await getattr(self, handler)()
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/script.py", line 571, in _async_call_service_step
    await service_task
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/core.py", line 1491, in async_call
    task.result()
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/core.py", line 1526, in _execute_service
    await handler.job.target(service_call)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/entity_component.py", line 213, in handle_service
    await self.hass.helpers.service.entity_service_call(
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/service.py", line 658, in entity_service_call
    future.result()  # pop exception if have
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/entity.py", line 856, in async_request_call
    await coro
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/service.py", line 695, in _handle_entity_call
    await result
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/light/__init__.py", line 448, in async_handle_light_on_service
    if ATTR_WHITE in params and COLOR_MODE_WHITE in supported_color_modes:
TypeError: argument of type 'NoneType' is not iterable


### Additional information

_No response_
@probot-home-assistant
Copy link

light documentation
light source
(message by IssueLinks)

brianegge added a commit to brianegge/core that referenced this issue Aug 31, 2021
emontnemery pushed a commit that referenced this issue Sep 1, 2021
* Fix None support_color_modes TypeError 

#55451

* Update __init__.py
@emontnemery
Copy link
Contributor

Fixed by #55497

bramkragten pushed a commit that referenced this issue Sep 1, 2021
* Fix None support_color_modes TypeError 

#55451

* Update __init__.py
@github-actions github-actions bot locked and limited conversation to collaborators Oct 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants