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

AppDaemon error when using a constrain_input_select #307

Closed
MagicMicky opened this issue May 23, 2021 · 4 comments
Closed

AppDaemon error when using a constrain_input_select #307

MagicMicky opened this issue May 23, 2021 · 4 comments

Comments

@MagicMicky
Copy link

I believe I updated either AppDaemon and/or ControllerX recently. Since then my ControllerX apps which contains contrain_input_select fail and error out in AppDaemon with the following error:

2021-05-23 13:06:45.864181 WARNING AppDaemon: ------------------------------------------------------------
2021-05-23 13:06:45.863676 WARNING AppDaemon: Unexpected error during process_event()
2021-05-23 13:06:45.863187 WARNING AppDaemon: ------------------------------------------------------------
2021-05-23 13:06:45.680601 WARNING AppDaemon: ------------------------------------------------------------
2021-05-23 13:06:45.680261 WARNING AppDaemon: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/events.py", line 225, in process_event
    await self.process_event_callbacks(namespace, data)
  File "/usr/lib/python3.8/site-packages/appdaemon/events.py", line 330, in process_event_callbacks
    executed = await self.AD.threading.dispatch_worker(
  File "/usr/lib/python3.8/site-packages/appdaemon/threading.py", line 731, in dispatch_worker
    constrained = await self.check_constraint(
  File "/usr/lib/python3.8/site-packages/appdaemon/threading.py", line 553, in check_constraint
    unconstrained = await utils.run_async_sync_func(self, method, value)
  File "/usr/lib/python3.8/site-packages/appdaemon/utils.py", line 329, in run_async_sync_func
    result = await run_in_executor(self, method, *args, **kwargs)
  File "/usr/lib/python3.8/site-packages/appdaemon/utils.py", line 299, in run_in_executor
    response = future.result()
  File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.8/site-packages/appdaemon/plugins/hass/hassapi.py", line 330, in constrain_input_select
    if entity in state and state[entity]["state"] not in values:
TypeError: argument of type 'coroutine' is not iterable

Example of a controllerX configuration

salon_music_controller_everywhere:
  module: controllerx
  class: E1744MediaPlayerController
  controller: "68:xx:xx:xx:xx:xx:xx:xx"
  integration: zha
  delay: 500
  volume_steps: 20
  media_player: media_player.everywhere
  constrain_input_select: input_select.everywhere_playback_status,playing
  actions: 
    - move_1_195
    - move_0_195
    - stop

I suppose it might be an AppDaemon error and not a ControllerX error, but my knowledge here is super limited so thought about starting here.

@darksider4all
Copy link

Having the same exact issue, but with lights

@darksider4all
Copy link

it seems deleting the actual constrain fixes the issue

xaviml added a commit that referenced this issue May 23, 2021
@xaviml
Copy link
Owner

xaviml commented May 23, 2021

Hi @MagicMicky and @darksider4all,

Thank you for reporting this bug. I have released a patch v4.11.2 that should fix this issue. It will be ready to download in 5 minutes after this post.

Let me know if you keep getting the error after upgrading and restarting AppDaemon.

Regards,
Xavi M.

@xaviml xaviml closed this as completed May 23, 2021
@MagicMicky
Copy link
Author

Working (after update + restart of Home assistant and AppDaemon)

Thanks a lot for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants