openhab-scripting 5.46.0 → 5.46.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 185967fd947cf9a2dafa36a14ed1847c46b6c4bf579855d1c26c2c7813164fa1
|
|
4
|
+
data.tar.gz: 161f3f62083751c1dda257078aac9e229cf9666b47dde175499714a7721b71d0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f754fbb6eb44e1a9e776e80af7dfbc317d06cfa8eb1eb79f1246e022bc027bfa7f163a210ef06c7c1e7920a46e3d6959a8bfee17c25c10c8bfbd9e40eb7318ea
|
|
7
|
+
data.tar.gz: a9d9095df6de53da7b4b69542b7c49807115a40692242c9abddb91b6a905e697c8c1ba765dd19d275e3a1ee6f744ee3f94407a8f79feb9ae9e9110a82b922781
|
|
@@ -54,13 +54,13 @@ module OpenHAB
|
|
|
54
54
|
# @!visibility private
|
|
55
55
|
def <(other)
|
|
56
56
|
check_type(other)
|
|
57
|
-
uid
|
|
57
|
+
uid.start_with?("#{other.uid}_")
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
# @!visibility private
|
|
61
61
|
def <=(other)
|
|
62
62
|
check_type(other)
|
|
63
|
-
uid.start_with?(other.uid)
|
|
63
|
+
uid == other.uid || uid.start_with?("#{other.uid}_")
|
|
64
64
|
end
|
|
65
65
|
|
|
66
66
|
# @!visibility private
|
|
@@ -72,13 +72,13 @@ module OpenHAB
|
|
|
72
72
|
# @!visibility private
|
|
73
73
|
def >=(other)
|
|
74
74
|
check_type(other)
|
|
75
|
-
other
|
|
75
|
+
other <= self
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
# @!visibility private
|
|
79
79
|
def >(other)
|
|
80
80
|
check_type(other)
|
|
81
|
-
|
|
81
|
+
other < self
|
|
82
82
|
end
|
|
83
83
|
|
|
84
84
|
# @return [String]
|
|
@@ -381,7 +381,7 @@ module OpenHAB
|
|
|
381
381
|
# Property = SemanticTag
|
|
382
382
|
|
|
383
383
|
# put ourself into the global namespace, replacing the action
|
|
384
|
-
Object.send(:remove_const, :Semantics)
|
|
384
|
+
Object.send(:remove_const, :Semantics) if Object.const_defined?(:Semantics)
|
|
385
385
|
::Semantics = self # rubocop:disable Naming/ConstantName
|
|
386
386
|
|
|
387
387
|
#
|
|
@@ -132,18 +132,20 @@ module OpenHAB
|
|
|
132
132
|
|
|
133
133
|
# @!visibility private
|
|
134
134
|
def add(builder)
|
|
135
|
-
if DSL.items
|
|
135
|
+
if (old_item = DSL.items[builder.name])
|
|
136
136
|
raise ArgumentError, "Item #{builder.name} already exists" unless @update
|
|
137
137
|
|
|
138
138
|
# Use provider.get because openHAB's ManagedProvider does not support the #[] method.
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
# Note that ManagedProvider stores PersistableItem objects, not the actual item,
|
|
140
|
+
# so we cannot use provider.get as old_item. We'll get it from the Item Registry instead.
|
|
141
|
+
unless provider.get(builder.name)
|
|
142
|
+
raise FrozenError, "Item #{builder.name} is managed by #{old_item.provider}"
|
|
141
143
|
end
|
|
142
144
|
|
|
143
145
|
item = builder.build
|
|
144
|
-
if item.config_eql?(old_item)
|
|
146
|
+
if item.config_eql?(old_item.__getobj__)
|
|
145
147
|
logger.debug { "Not replacing existing item #{item.uid} because it is identical" }
|
|
146
|
-
item = old_item
|
|
148
|
+
item = old_item.__getobj__
|
|
147
149
|
else
|
|
148
150
|
logger.debug { "Replacing existing item #{item.uid} because it is not identical" }
|
|
149
151
|
provider.update(item)
|
|
@@ -169,6 +171,7 @@ module OpenHAB
|
|
|
169
171
|
if !channel.include?(":") &&
|
|
170
172
|
(thing = builder.thing ||
|
|
171
173
|
thing = builder.groups.find { |g| g.is_a?(GroupItemBuilder) && g.thing }&.thing)
|
|
174
|
+
thing = thing.uid if thing.respond_to?(:uid)
|
|
172
175
|
channel = "#{thing}:#{channel}"
|
|
173
176
|
end
|
|
174
177
|
|
|
@@ -248,7 +251,7 @@ module OpenHAB
|
|
|
248
251
|
# Autoupdate setting
|
|
249
252
|
# @return [true, false, nil]
|
|
250
253
|
attr_accessor :autoupdate
|
|
251
|
-
# @return [String, Core::Things::Thing, Core::Things::ThingUID, nil]
|
|
254
|
+
# @return [String, Core::Things::Thing, Core::Things::ThingUID, DSL::Things::Builder::ThingBuilder, nil]
|
|
252
255
|
# {Core::Things::ThingUID Thing} from which to resolve relative channel ids
|
|
253
256
|
attr_accessor :thing
|
|
254
257
|
# @return [Core::Items::Metadata::NamespaceHash]
|
|
@@ -302,7 +305,7 @@ module OpenHAB
|
|
|
302
305
|
# @param tags [String, Symbol, Semantics::Tag, Array<String, Symbol, Semantics::Tag>, nil]
|
|
303
306
|
# Fluent alias for `tag`.
|
|
304
307
|
# @param autoupdate [true, false, nil] Autoupdate setting (see {ItemBuilder#autoupdate})
|
|
305
|
-
# @param thing [String, Core::Things::Thing, Core::Things::ThingUID, nil]
|
|
308
|
+
# @param thing [String, Core::Things::Thing, Core::Things::ThingUID, DSL::Things::Builder::ThingBuilder, nil]
|
|
306
309
|
# A Thing to be used as the base for the channel.
|
|
307
310
|
# @param channel [String, Symbol, Core::Things::ChannelUID, Core::Things::Channel, nil]
|
|
308
311
|
# Channel to link the item to (see {ItemBuilder#channel}).
|
|
@@ -786,7 +789,7 @@ module OpenHAB
|
|
|
786
789
|
# @return [String, nil]
|
|
787
790
|
attr_accessor :function
|
|
788
791
|
# A thing to be used as the base for the channel of any member items
|
|
789
|
-
# @return [Core::Things::ThingUID, Core::Things::Thing, String, nil]
|
|
792
|
+
# @return [Core::Things::ThingUID, Core::Things::Thing, DSL::Things::Builder::ThingBuilder, String, nil]
|
|
790
793
|
attr_accessor :thing
|
|
791
794
|
# A prefix to be added to the name of any member items
|
|
792
795
|
# @return [String, nil]
|
|
@@ -800,7 +803,7 @@ module OpenHAB
|
|
|
800
803
|
|
|
801
804
|
# @param type [Symbol, nil] The base type for the group
|
|
802
805
|
# @param function [String, nil] The combiner function for this group
|
|
803
|
-
# @param thing [Core::Things::ThingUID, Core::Things::Thing, String, nil]
|
|
806
|
+
# @param thing [Core::Things::ThingUID, Core::Things::Thing, DSL::Things::Builder::ThingBuilder, String, nil]
|
|
804
807
|
# A Thing to be used as the base for the channel for any contained items.
|
|
805
808
|
# @param (see ItemBuilder#initialize)
|
|
806
809
|
def initialize(*, type: nil, function: nil, thing: nil, **)
|
|
@@ -95,16 +95,13 @@ module OpenHAB
|
|
|
95
95
|
builder.instance_eval(&block) if block
|
|
96
96
|
thing = builder.build
|
|
97
97
|
|
|
98
|
-
if DSL.things
|
|
98
|
+
if (old_thing = DSL.things[thing.uid])
|
|
99
99
|
raise ArgumentError, "Thing #{thing.uid} already exists" unless @update
|
|
100
|
+
raise FrozenError, "Thing #{thing.uid} is managed by #{thing.provider}" unless provider.get(thing.uid)
|
|
100
101
|
|
|
101
|
-
|
|
102
|
-
raise FrozenError, "Thing #{thing.uid} is managed by #{thing.provider}"
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
if thing.config_eql?(old_thing)
|
|
102
|
+
if thing.config_eql?(old_thing.__getobj__)
|
|
106
103
|
logger.debug { "Not replacing existing thing #{thing.uid}" }
|
|
107
|
-
thing = old_thing
|
|
104
|
+
thing = old_thing.__getobj__
|
|
108
105
|
else
|
|
109
106
|
provider.update(thing)
|
|
110
107
|
end
|
data/lib/openhab/dsl/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: openhab-scripting
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.46.
|
|
4
|
+
version: 5.46.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brian O'Connell
|
|
@@ -354,7 +354,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
354
354
|
- !ruby/object:Gem::Version
|
|
355
355
|
version: '0'
|
|
356
356
|
requirements: []
|
|
357
|
-
rubygems_version: 4.0.
|
|
357
|
+
rubygems_version: 4.0.4
|
|
358
358
|
specification_version: 4
|
|
359
359
|
summary: JRuby Helper Libraries for openHAB Scripting
|
|
360
360
|
test_files: []
|