openhab-scripting 5.30.1 → 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 +4 -4
- data/lib/openhab/core/types/hsb_type.rb +20 -0
- data/lib/openhab/dsl/version.rb +1 -1
- metadata +2 -2
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
|
@@ -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
|
@@ -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
|