openhab-scripting 3.3.0 → 3.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 01e9ddbd43a59fec9db3fa391d42cacb0cd1a03c7d116e995815df940847b28b
4
- data.tar.gz: ef98bb992444788122499056470c2fde3fbfbdb6659a72228df0f2c46bd8cecb
3
+ metadata.gz: 0c609ff8fbe875f98e26f7286f4a72fdd018b5bd96ec4a7272fb7d7ceacc9657
4
+ data.tar.gz: f5ca4401987517a11e1ddd0b632f5d0c5380751336175d9a21dba3cc16576308
5
5
  SHA512:
6
- metadata.gz: 4499127b7c667c3290eb3d106624649ff04eff597eb95668c868bcaf5236f99a9149adf4b74e4750e2d092bc5cd7c3cc8b56b6470968f34c6324985b8bec7472
7
- data.tar.gz: 93a18bda44e472326eb5952d089f5a8eb1f221bc566c861c9abee4cce08c21b5a8d29aa5168b05c5c54c3e61e613e1834ff01c39f18f57dcc2efc8d4c9eacbb5
6
+ metadata.gz: 3b3517f70a227da9d2795fc17b3c9642db3e2ef684bb2611281933d659f5fd14b51f9fcb5472dc2e49c5c051e4debfe560bc064652de41aa172ca0be006689d2
7
+ data.tar.gz: 1559069e15db427e37c0b13fe03f2cc69cf8aa67d9a943b92453c1c1bd3c192848a713a4f5f8e44c7a57fe1d6bde9a582ca8bbe792a46b5b8e007366cf7457dc
@@ -11,6 +11,7 @@ module OpenHAB
11
11
  # Support for OpenHAB Things
12
12
  #
13
13
  module Things
14
+ java_import Java::OrgOpenhabCoreThing::ThingStatus
14
15
  include OpenHAB::Log
15
16
 
16
17
  #
@@ -25,6 +26,22 @@ module OpenHAB
25
26
  define_action_methods
26
27
  end
27
28
 
29
+ #
30
+ # Defines boolean thing status methods
31
+ # uninitialized?
32
+ # initializing?
33
+ # unknown?
34
+ # online?
35
+ # offline?
36
+ # removing?
37
+ # removed?
38
+ #
39
+ # @return [Boolean] true if the thing status matches the name
40
+ #
41
+ ThingStatus.constants.each do |thingstatus|
42
+ define_method("#{thingstatus.to_s.downcase}?") { status == ThingStatus.value_of(thingstatus) }
43
+ end
44
+
28
45
  private
29
46
 
30
47
  java_import 'org.openhab.core.automation.annotation.RuleAction'
@@ -5,5 +5,5 @@
5
5
  #
6
6
  module OpenHAB
7
7
  # @return [String] Version of OpenHAB helper libraries
8
- VERSION = '3.3.0'
8
+ VERSION = '3.4.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: 3.3.0
4
+ version: 3.4.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: 2021-03-16 00:00:00.000000000 Z
11
+ date: 2021-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler