openhab-scripting 5.24.2 → 5.25.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: 5c0fb1468d6bd40e3c969eb3da64c2291998d1c25f869ce8eadcdee5d8025f82
4
- data.tar.gz: 1055efc1de0e69ecbd3f0c3ef7368f96c3edab4ae8395aeeb3da53b2bfcc2403
3
+ metadata.gz: 5dd540981ebe38c1c9caa47519ef602482ae3f3f9fb9bdfce0c9f7f82e8354e7
4
+ data.tar.gz: f41c35b263ae2806eb7bd0e5c921cf77992c772165b3dd772515f6208682b20e
5
5
  SHA512:
6
- metadata.gz: 779278a803232e079c5fc50f3094259b9d27500b82bc872bc7f38731f5dd836612a2582b558e50041d3098578fe1af3d2aa856c6e6400c3a854dba474e043a64
7
- data.tar.gz: c3426e6d46f3edf2a6807b65c02ef12e4c2130ab943ec930b9815720458d45d0fc7a272a72829bd8b00be96c2e6549829cb5a07def11fbf647ccea942cfd89a7
6
+ metadata.gz: 15c663deb2da069fb03179638b89d7df1068c5dd1f7b16312dce90c81d97a8b949c6b60208855ea2b7c4ec6210aa2dca57ec7a29dc8ddc5abb3cc4ffe7ac4572
7
+ data.tar.gz: 67043ce7f88d1c5cacb92f2cb172b7faaeb376d0ad2258901b603e61241e70732f41f5c2abcc05880daac2446fe9031f298112910c29bb69ffbdf81e18c760bc
@@ -83,6 +83,26 @@ module OpenHAB
83
83
  @group = group_item
84
84
  end
85
85
 
86
+ #
87
+ # Adds a member to the group
88
+ #
89
+ # @param [Item, String] member The item to add to the group
90
+ # @return [Members] self
91
+ #
92
+ def add(member)
93
+ if member.is_a?(String)
94
+ member = items[member]
95
+ raise ArgumentError, "Item not found: #{member}" if member.nil?
96
+ end
97
+
98
+ member = member.__getobj__ if member.is_a?(Proxy)
99
+ raise ArgumentError, "Member must be an Item" unless member.is_a?(Item)
100
+
101
+ group.add_member(member)
102
+ self
103
+ end
104
+ alias_method :<<, :add
105
+
86
106
  # Explicit conversion to Array
87
107
  #
88
108
  # @return [Array]
@@ -171,6 +171,11 @@ module OpenHAB
171
171
  bridge_uid && EntityLookup.lookup_thing(bridge_uid)
172
172
  end
173
173
 
174
+ # @return [true,false] true if this Thing is a bridge
175
+ def bridge?
176
+ is_a?(org.openhab.core.thing.Bridge)
177
+ end
178
+
174
179
  # @return [String]
175
180
  def inspect
176
181
  r = "#<OpenHAB::Core::Things::Thing #{uid}"
@@ -4,6 +4,6 @@ module OpenHAB
4
4
  module DSL
5
5
  # Version of openHAB helper libraries
6
6
  # @return [String]
7
- VERSION = "5.24.2"
7
+ VERSION = "5.25.0"
8
8
  end
9
9
  end
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.24.2
4
+ version: 5.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian O'Connell
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-07-30 00:00:00.000000000 Z
13
+ date: 2024-08-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -490,7 +490,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
490
490
  - !ruby/object:Gem::Version
491
491
  version: '0'
492
492
  requirements: []
493
- rubygems_version: 3.5.16
493
+ rubygems_version: 3.5.17
494
494
  signing_key:
495
495
  specification_version: 4
496
496
  summary: JRuby Helper Libraries for openHAB Scripting