openhab-scripting 4.34.1 → 4.35.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/states.rb +12 -0
- data/lib/openhab/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a64a452ca8ff7c31d08ceed61a6e2d466250438365ea71c4de1c968b33198f8c
|
|
4
|
+
data.tar.gz: 31e41c724ad7b7871e913044259f5d3736130d5634d2f9301b98c7093b97f804
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1cb0812ede637a43674c260dce7124a38fce48c0940cae506125f9c5d6c3ebc3fa08d229a92155060fc5eb816b9e946874cebbc6e0d9654b3405e75879b1dbfd
|
|
7
|
+
data.tar.gz: cf04212fd7483729494be64840f74c9d6d5241c35c87e4c46f7207c8a007a9d0c537a8379481172d8395cf27c74eae5764d2d2e65ef984d7478104778e19c4a0
|
data/lib/openhab/dsl/states.rb
CHANGED
|
@@ -28,6 +28,18 @@ module OpenHAB
|
|
|
28
28
|
end
|
|
29
29
|
states
|
|
30
30
|
end
|
|
31
|
+
|
|
32
|
+
#
|
|
33
|
+
# Check if all the given items have a state (not UNDEF or NULL)
|
|
34
|
+
#
|
|
35
|
+
# @param [Array] items whose state must be non-nil
|
|
36
|
+
# @param [<Type>] check_things when true, also ensures that all linked things are online
|
|
37
|
+
#
|
|
38
|
+
# @return [Boolean] true if all the items have a state, false otherwise
|
|
39
|
+
#
|
|
40
|
+
def state?(*items, things: false)
|
|
41
|
+
items.flatten.all? { |item| (!things || item.things.all?(&:online?)) && item.state? }
|
|
42
|
+
end
|
|
31
43
|
end
|
|
32
44
|
|
|
33
45
|
module Support
|
data/lib/openhab/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: openhab-scripting
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.
|
|
4
|
+
version: 4.35.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brian O'Connell
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-03-
|
|
11
|
+
date: 2022-03-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|