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

[pidcontroller] Fix for handling trigger input in action #9842

Merged
merged 3 commits into from
Jan 19, 2021

Conversation

Hilbrand
Copy link
Member

No description provided.

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
keys in action context from trigger are passed with prefix of trigger  name.
This change removes the prefix to get the actual name and checks if it matches an item.
Else it tries the original name.

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
@Hilbrand Hilbrand added the bug An unexpected problem or unintended behavior of an add-on label Jan 16, 2021
Copy link
Member

@fwolter fwolter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this!

@@ -204,7 +204,7 @@ private double getItemValueAsNumber(Item item) throws PIDException {

@Override
public void receive(Event event) {
if (event instanceof ItemStateChangedEvent) {
if (event instanceof ItemStateChangedEvent && commandTopic.isPresent()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't invoke calculate() anymore if no command item is set.

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
@Hilbrand Hilbrand requested a review from fwolter January 18, 2021 07:29
Copy link
Member

@fwolter fwolter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@fwolter fwolter merged commit b5b7879 into openhab:main Jan 19, 2021
@fwolter fwolter modified the milestone: 3.1 Jan 19, 2021
@Hilbrand Hilbrand deleted the fix-pid-action branch January 19, 2021 09:35
nowaterman pushed a commit to nowaterman/openhab-addons that referenced this pull request Jan 19, 2021
* [pidcontroller] Catch empty commandTopic


* [pidcontroller] Fix handling action

keys in action context from trigger are passed with prefix of trigger  name.
This change removes the prefix to get the actual name and checks if it matches an item.
Else it tries the original name.


* [pidcontroller] review comment
@wborn wborn added this to the 3.1 milestone Jan 22, 2021
themillhousegroup pushed a commit to themillhousegroup/openhab2-addons that referenced this pull request May 10, 2021
* [pidcontroller] Catch empty commandTopic

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>

* [pidcontroller] Fix handling action

keys in action context from trigger are passed with prefix of trigger  name.
This change removes the prefix to get the actual name and checks if it matches an item.
Else it tries the original name.

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>

* [pidcontroller] review comment

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
Signed-off-by: John Marshall <john.marshall.au@gmail.com>
thinkingstone pushed a commit to thinkingstone/openhab-addons that referenced this pull request Nov 7, 2021
* [pidcontroller] Catch empty commandTopic

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>

* [pidcontroller] Fix handling action

keys in action context from trigger are passed with prefix of trigger  name.
This change removes the prefix to get the actual name and checks if it matches an item.
Else it tries the original name.

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>

* [pidcontroller] review comment

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
marcfischerboschio pushed a commit to bosch-io/openhab-addons that referenced this pull request May 5, 2022
* [pidcontroller] Catch empty commandTopic

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>

* [pidcontroller] Fix handling action

keys in action context from trigger are passed with prefix of trigger  name.
This change removes the prefix to get the actual name and checks if it matches an item.
Else it tries the original name.

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>

* [pidcontroller] review comment

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants