Skip to content

Commit 619b899

Browse files
authored
Avoid having to re-lookup Semantics::Property on every reference in 3.4.x (#66)
Signed-off-by: Cody Cutrer <[email protected]>
1 parent c07a58d commit 619b899

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/openhab/core/items/semantics.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ def self.const_missing(sym)
491491
logger.trace("const missing, performing Semantics Lookup for: #{sym}")
492492
# @deprecated OH3.4 - the Property tag had an ID of "MeasurementProperty" in OH3.4. This was corrected in OH4.
493493
# make sure we compare against pre-release versions
494+
target_sym = sym
494495
if sym == :Property && Gem::Version.new(Core::VERSION) < Gem::Version.new("4.0.0.M1")
495496
sym = :MeasurementProperty
496497
end
@@ -499,7 +500,7 @@ def self.const_missing(sym)
499500
&.then do |tag|
500501
tag = tag.ruby_class
501502
tag.singleton_class.include(TagClassMethods)
502-
const_set(sym, tag)
503+
const_set(target_sym, tag)
503504
end
504505
end
505506

0 commit comments

Comments
 (0)