openhab-scripting 4.34.1 → 4.35.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b5fd36cfc11c1123c6dc979a7d7072ee7aff804deded7d4bb72716be4c2e216
4
- data.tar.gz: f324548ea1075012f58076195a8c25d8cb6bb4afe62344d9752ba4a2415a4394
3
+ metadata.gz: a64a452ca8ff7c31d08ceed61a6e2d466250438365ea71c4de1c968b33198f8c
4
+ data.tar.gz: 31e41c724ad7b7871e913044259f5d3736130d5634d2f9301b98c7093b97f804
5
5
  SHA512:
6
- metadata.gz: 49b5fab340c77c046ad534568efb939206ab11824f6f08c56622a691d066fd4ce79c308e153d4b45d408cb901f461f5b97c6b14b00deceaba70efbdb46475e2c
7
- data.tar.gz: 70c98aaec888f7c889a3bcac861caf216fee51b71c0f086c624ad4caf51f497f6db56c4b218e808524fa3b903d2c149a4c580a862878158fd988d12eb2ce8659
6
+ metadata.gz: 1cb0812ede637a43674c260dce7124a38fce48c0940cae506125f9c5d6c3ebc3fa08d229a92155060fc5eb816b9e946874cebbc6e0d9654b3405e75879b1dbfd
7
+ data.tar.gz: cf04212fd7483729494be64840f74c9d6d5241c35c87e4c46f7207c8a007a9d0c537a8379481172d8395cf27c74eae5764d2d2e65ef984d7478104778e19c4a0
@@ -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
@@ -5,5 +5,5 @@
5
5
  #
6
6
  module OpenHAB
7
7
  # @return [String] Version of OpenHAB helper libraries
8
- VERSION = '4.34.1'
8
+ VERSION = '4.35.0'
9
9
  end
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.34.1
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-16 00:00:00.000000000 Z
11
+ date: 2022-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler