openhab-scripting 5.41.0 → 5.42.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/items/item.rb +14 -4
- data/lib/openhab/dsl/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: e14c40c5db6a5210c78c66a315ab449cf71e2960f6de3675f01146b7dd441610
|
4
|
+
data.tar.gz: 7862488bf7df6e277c9833e11b15d0e5d54fe6eff3a62fa159dfe26641ab8aad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e72be1db208c31047b81bbba773e6e1f930c7eb47cf61740e151c2d4918e96e192a36fbc3ac94e3ecbece62811f01792574f4bc78d386e14015e66bf4ebf73af
|
7
|
+
data.tar.gz: 21a972d3941e63c8ca7729f660c7f60cba586f6d210bed9294c6d81cbfb33df6b9897aa7d4258cdf9f199188a8f90301ac3d353278fb96f4a3e86e0ec198d8d7
|
@@ -91,20 +91,30 @@ module OpenHAB
|
|
91
91
|
label || name
|
92
92
|
end
|
93
93
|
|
94
|
-
# @!attribute [r]
|
94
|
+
# @!attribute [r] display_state
|
95
95
|
#
|
96
96
|
# Format the item's state according to its state description
|
97
97
|
#
|
98
|
-
# This may include running a transformation
|
98
|
+
# This may include running a transformation, if one is defined in the
|
99
|
+
# state description's pattern, otherwise it will format according to the
|
100
|
+
# pattern. If no state description is defined, the state will simply
|
101
|
+
# be returned as a string.
|
102
|
+
#
|
103
|
+
# @note While this method is also aliased to `#transformed_state` to
|
104
|
+
# match the field available in the openHAB REST API, unlike the API it
|
105
|
+
# will always return a value even if the state description has no
|
106
|
+
# transformation.
|
99
107
|
#
|
100
108
|
# @return [String] The formatted state
|
101
109
|
#
|
102
110
|
# @example
|
103
|
-
# logger.info(Exterior_WindDirection.
|
111
|
+
# logger.info(Exterior_WindDirection.display_state) # => "NE (36°)"
|
104
112
|
#
|
105
|
-
def
|
113
|
+
def display_state
|
106
114
|
Item.item_states_event_builder.get_display_state(self)
|
107
115
|
end
|
116
|
+
alias_method :transformed_state, :display_state
|
117
|
+
alias_method :formatted_state, :display_state
|
108
118
|
|
109
119
|
#
|
110
120
|
# Send a command to this item
|
data/lib/openhab/dsl/version.rb
CHANGED