openhab-scripting 5.30.0 → 5.31.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d1996259cb097848c88f6ed61d4d715710299a6f9ac93e4e8ccf2925b651c7e
|
4
|
+
data.tar.gz: 4283efc59d3e6e0df288c79f2ab6e8220c64441f4d5bd63474b5075690c1556b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d9d5ef94c19724d7c4f58e349c41def3c538c7240a4f744c44dd15dd96692b9ffb368e4173ee43dff5f5d56a3128610a03411589d2c668d3a7418c3ad84a52e
|
7
|
+
data.tar.gz: dcd5c517c8e536f25a629a32d4681ce488168c07c23739c775ea147184d640aa36c1eea3c43ffb8d228051c4d7a19e62b5fb8507c4107b4baa442315ad58ec15
|
@@ -103,10 +103,10 @@ module Enumerable
|
|
103
103
|
|
104
104
|
# Send a command to every item in the collection, even when {OpenHAB::DSL.ensure_states! ensure_states!} is in effect.
|
105
105
|
# @return [self]
|
106
|
-
def command!(command)
|
106
|
+
def command!(command, **kwargs)
|
107
107
|
# We cannot alias this to #command above, otherwise it will call
|
108
108
|
# DSL::Items::Ensure::Item#command which checks for ensure_states
|
109
|
-
each { |i| i.command!(command) }
|
109
|
+
each { |i| i.command!(command, **kwargs) }
|
110
110
|
self
|
111
111
|
end
|
112
112
|
|
@@ -198,7 +198,7 @@ module Enumerable
|
|
198
198
|
# Send a toggle command to every item in the collection
|
199
199
|
# @return [self]
|
200
200
|
#
|
201
|
-
def toggle
|
202
|
-
each(
|
201
|
+
def toggle(source: nil)
|
202
|
+
each { |i| i.toggle(source: source) }
|
203
203
|
end
|
204
204
|
end
|
@@ -12,6 +12,11 @@ module OpenHAB
|
|
12
12
|
# {HSBType} is a complex type with constituents for hue, saturation and
|
13
13
|
# brightness and can be used for color items.
|
14
14
|
class HSBType < PercentType
|
15
|
+
if OpenHAB::Core.version >= OpenHAB::Core::V4_0
|
16
|
+
java_import org.openhab.core.util.ColorUtil
|
17
|
+
private_constant :ColorUtil
|
18
|
+
end
|
19
|
+
|
15
20
|
# @!constant BLACK
|
16
21
|
# @return [HSBType]
|
17
22
|
# @!constant WHITE
|
@@ -96,6 +101,14 @@ module OpenHAB
|
|
96
101
|
|
97
102
|
super(*args)
|
98
103
|
end
|
104
|
+
|
105
|
+
# Create HSBType from a color temperature
|
106
|
+
# @param cct [QuantityType, Number] The color temperature (assumed in Kelvin, if not a QuantityType)
|
107
|
+
# @return [HSBType]
|
108
|
+
# @since openHAB 4.3
|
109
|
+
def from_cct(cct)
|
110
|
+
from_xy(*ColorUtil.kelvin_to_xy((cct | "K").double_value))
|
111
|
+
end
|
99
112
|
end
|
100
113
|
|
101
114
|
#
|
@@ -175,6 +188,13 @@ module OpenHAB
|
|
175
188
|
# @!method to_xy
|
176
189
|
# Convert to the xyY values representing this object's color in CIE XY color model
|
177
190
|
# @return [[PercentType, PercentType, PercentType]]
|
191
|
+
|
192
|
+
# @!attribute [r] cct
|
193
|
+
# @return [QuantityType] The color temperature in Kelvin
|
194
|
+
# @since openHAB 4.3
|
195
|
+
def cct
|
196
|
+
ColorUtil.xy_to_kelvin(to_xy[0..1].map { |x| x.double_value / 100 }) | "K"
|
197
|
+
end
|
178
198
|
end
|
179
199
|
end
|
180
200
|
end
|
data/lib/openhab/dsl/version.rb
CHANGED
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.
|
4
|
+
version: 5.31.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-10-
|
13
|
+
date: 2024-10-03 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.
|
493
|
+
rubygems_version: 3.5.21
|
494
494
|
signing_key:
|
495
495
|
specification_version: 4
|
496
496
|
summary: JRuby Helper Libraries for openHAB Scripting
|