Navigation Menu

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

Fix detection of controller events with deCONZ #44

Merged
merged 4 commits into from Apr 23, 2021
Merged

Conversation

EPMatt
Copy link
Owner

@EPMatt EPMatt commented Apr 20, 2021

Thank you for taking the time to work on a Pull Request. Your contribution is really appreciated! 🎉
Please don't delete any part of the template, since keeping the provided structure will help maintainers to review your work more rapidly.

Sections marked as * are required and need to be filled in.

Proposed change*

Fix detection of controller events with deCONZ. This preserves the fix for double press events introduced in previous updates.
It works by converting deconz_event events payload into strings, ensuring all RAW events comparisons within the blueprint are valid and always involve two string operands.

Closes #42.

Checklist*

  • I followed sections of the Contribution Guidelines relevant to changes I'm proposing.
  • I properly tested proposed changes on my system and confirm that they are working as expected.
  • I formatted files with Prettier using the command npm run format before submitting my Pull Request.

@EPMatt
Copy link
Owner Author

EPMatt commented Apr 20, 2021

Hi @eloo,
could you please check if this PR solves the issue you reported?

Thanks!

@eloo
Copy link

eloo commented Apr 21, 2021

Hi @EPMatt
of course i will give it a try.
I will give feedback till the end of the day.

Thanks a lot

@eloo
Copy link

eloo commented Apr 21, 2021

@EPMatt
Hi seems that your change is not fixing the problem.
But i've figured out that when you wrap the trigger_action with string in the condition it seems to work (at least for deconz)

like this

      - conditions: "{{ (trigger_action | string)  in button_short }}"

@EPMatt
Copy link
Owner Author

EPMatt commented Apr 21, 2021

@eloo I took some time to better understand why the fix does not work. I think the issue is in how Home Assistant renders variables in the variables script block. It looks like any numeric-like value, even if explicitly converted to string via the Jinja string filter, is converted into an int, thus making the fix I pushed yesterday completely useless.

I don't know whether this is an expected behaviour, but I'm now opening an issue on HA Core to report the problem.

Thank you very much for your test, that pointed me in the right direction. :)
I'll fix the issue in a few minutes. 👍🏻

@EPMatt
Copy link
Owner Author

EPMatt commented Apr 21, 2021

Hi @eloo,
I've just pushed a fix for this issue.
Could you please check if the automation is now working as expected?

Thanks!

@eloo
Copy link

eloo commented Apr 22, 2021

@EPMatt okay yes, an implicit type conversion sounds also unexpected to me.

i will give your fix a try in the evening.

Thanks!

@eloo
Copy link

eloo commented Apr 22, 2021

@EPMatt
its working as expected.

thanks

@EPMatt
Copy link
Owner Author

EPMatt commented Apr 23, 2021

Hi @eloo,

Thank you for your feedback, I'm happy to hear that your issue is solved. :)
I'm now updating the changelog and merging this PR.

Thanks again!

@EPMatt EPMatt merged commit 5f1ca80 into main Apr 23, 2021
github-actions bot pushed a commit that referenced this pull request Apr 23, 2021
…ith deCONZ (#44)

* fix detection of controller events with deconz

* force convert trigger_action to string

* remove useless jinja filter

* update changelog
@EPMatt EPMatt deleted the EPMatt/issue42 branch May 15, 2021 20:19
@github-actions
Copy link
Contributor

Hi there,

🔒 This pull request has been automatically locked since there has not been any recent activity after it was closed.
Please open a new issue for related bugs. If you want to submit a contribution to the project, you can open a new PR.

Thanks!

@github-actions github-actions bot locked and limited conversation to collaborators Feb 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IKEA E1812 Deconz not working
2 participants