Skip to content

Fix using items in case statements#510

Merged
ccutrer merged 1 commit intoopenhab:mainfrom
ccutrer:item-case-equality
Jan 28, 2026
Merged

Fix using items in case statements#510
ccutrer merged 1 commit intoopenhab:mainfrom
ccutrer:item-case-equality

Conversation

@ccutrer
Copy link
Member

@ccutrer ccutrer commented Jan 27, 2026

No description provided.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
@ccutrer ccutrer added the bug Something isn't working label Jan 27, 2026
@ccutrer ccutrer requested review from Copilot and jimtng January 27, 2026 22:04
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for using item proxies in Ruby case statements by implementing the === (case equality) operator. The implementation follows the same pattern as the existing == operator to ensure proxied items can be properly compared in case/when constructs.

Changes:

  • Implemented the === operator for item proxies to delegate to underlying objects
  • Added tests to verify the case equality operator works correctly with item proxies

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
lib/openhab/core/proxy.rb Implements the === operator by delegating to underlying objects when comparing proxies of the same class, mirroring the pattern used by the == operator
spec/openhab/core/items/proxy_spec.rb Adds tests for the === operator with rubocop directives to allow case equality testing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ccutrer ccutrer merged commit 8fd7ad5 into openhab:main Jan 28, 2026
19 of 21 checks passed
@ccutrer ccutrer deleted the item-case-equality branch January 28, 2026 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants