openhab-scripting 2.19.3 → 2.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/openhab/dsl/monkey_patch/items/metadata.rb +12 -0
- 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: '08f9a551904b3396bb8f7944c5eb239250b00f68309f53c23e98203bd440ec85'
|
4
|
+
data.tar.gz: 8089ce9cc9fe7aea8d0b7e6c0f3ec8b7b298cd5584e4a1d2ec0c9ae6deb6583f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44a0c0387d5e738a33a108448c5b2d4f6bd0b6e09769690e072d6a370e8bd044e4d7dade6773e5afc70c0a78be74b223b70dbb63b13dfc720b0ad9ee15d98546
|
7
|
+
data.tar.gz: 7415332d0525749b1d50d53ee8dfa3829a4f9ee51d308f9d2d4808279260c1bc5eda212d2c0714bace5d0cd25e8bf2159f115ba2d2b8382d365b557d2e4a8dbb
|
@@ -134,6 +134,18 @@ module OpenHAB
|
|
134
134
|
end
|
135
135
|
end
|
136
136
|
|
137
|
+
#
|
138
|
+
# Implements Hash#dig-like functionaity to metadata
|
139
|
+
#
|
140
|
+
# @param [String] key The first key
|
141
|
+
# @param [Array<String, Symbol>] keys More keys to dig deeper
|
142
|
+
#
|
143
|
+
# @return [OpenHAB::DSL::MonkeyPatch::Items::MetadataItem], or nil if the namespace doesn't exist
|
144
|
+
#
|
145
|
+
def dig(key, *keys)
|
146
|
+
keys.empty? ? self[key]&.value : self[key]&.dig(*keys)
|
147
|
+
end
|
148
|
+
|
137
149
|
#
|
138
150
|
# Enumerates through all the namespaces
|
139
151
|
#
|
data/lib/openhab/version.rb
CHANGED