openhab-scripting 4.8.5 → 4.9.0
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 +4 -4
- data/lib/openhab/dsl/rules/guard.rb +4 -4
- data/lib/openhab/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 18381f7d16d590838748802e7535c611279c6b251fc5f782f9f11247f856074b
|
|
4
|
+
data.tar.gz: 1f339a40040d41445020eb2a460269eba1088554034a064c1a335e2e85f17be4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3611a93e20e13b0c5a63354e8c1082466f279e7a9b83b5c352a2b357e09f45411035c6bb1baa79575f1c7e9480ae66a9f651a635dba3130b791dcdf9eb3c4f32
|
|
7
|
+
data.tar.gz: 69f57f2931d50f868742682fa8d400348dc93670dd8ba6f6172477bbc02d9e297203d6466030c52d6055cae740b1fa8f05e8889faf7bef655d650105587ccfc5
|
|
@@ -13,13 +13,13 @@ module OpenHAB
|
|
|
13
13
|
include OpenHAB::DSL::Rules::Property
|
|
14
14
|
|
|
15
15
|
prop_array(:only_if) do |item|
|
|
16
|
-
unless item.is_a?(Proc) || item.respond_to?(:truthy?)
|
|
16
|
+
unless item.is_a?(Proc) || [item].flatten.all? { |it| it.respond_to?(:truthy?) }
|
|
17
17
|
raise ArgumentError, "Object passed to only_if must respond_to 'truthy?'"
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
prop_array(:not_if) do |item|
|
|
22
|
-
unless item.is_a?(Proc) || item.respond_to?(:truthy?)
|
|
22
|
+
unless item.is_a?(Proc) || [item].flatten.all? { |it| it.respond_to?(:truthy?) }
|
|
23
23
|
raise ArgumentError, "Object passed to not_if must respond_to 'truthy?'"
|
|
24
24
|
end
|
|
25
25
|
end
|
|
@@ -113,7 +113,7 @@ module OpenHAB
|
|
|
113
113
|
# @return [Boolean] True if criteria are satisfied, false otherwise
|
|
114
114
|
#
|
|
115
115
|
def process_not_if(event, items, procs)
|
|
116
|
-
items.none?(&:truthy?) && procs.none? { |proc| proc.call(event) }
|
|
116
|
+
items.flatten.none?(&:truthy?) && procs.none? { |proc| proc.call(event) }
|
|
117
117
|
end
|
|
118
118
|
|
|
119
119
|
#
|
|
@@ -126,7 +126,7 @@ module OpenHAB
|
|
|
126
126
|
# @return [Boolean] True if criteria are satisfied, false otherwise
|
|
127
127
|
#
|
|
128
128
|
def process_only_if(event, items, procs)
|
|
129
|
-
items.all?(&:truthy?) && procs.all? { |proc| proc.call(event) }
|
|
129
|
+
items.flatten.all?(&:truthy?) && procs.all? { |proc| proc.call(event) }
|
|
130
130
|
end
|
|
131
131
|
end
|
|
132
132
|
end
|
data/lib/openhab/version.rb
CHANGED