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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6920b2ea75f2c8d7e849173181ebbcd05d40006c2cd70785b119b8645e34032e
4
- data.tar.gz: 91cd7e588646072b2cd82ffece697dc8d74b8ddad377575e88748adac7325b63
3
+ metadata.gz: e14c40c5db6a5210c78c66a315ab449cf71e2960f6de3675f01146b7dd441610
4
+ data.tar.gz: 7862488bf7df6e277c9833e11b15d0e5d54fe6eff3a62fa159dfe26641ab8aad
5
5
  SHA512:
6
- metadata.gz: 9e330a848117416e972df7b10e9735e27c20d71a622242a12d4e4dba7401ce9eb4b9e82171830d328d282d852d4e68e9d11d7ed16e495743658f14d0a6e8ea3a
7
- data.tar.gz: 367be6bb928558652035129c6ec0d8c372ab6cedcc04a914d247a9cf3421830c1a5a188197361a7334c0036f813553ed0168df71a5e74e7d4be7920e51a90485
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] formatted_state
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.formatted_state) # => "NE (36°)"
111
+ # logger.info(Exterior_WindDirection.display_state) # => "NE (36°)"
104
112
  #
105
- def formatted_state
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
@@ -4,6 +4,6 @@ module OpenHAB
4
4
  module DSL
5
5
  # Version of openHAB helper libraries
6
6
  # @return [String]
7
- VERSION = "5.41.0"
7
+ VERSION = "5.42.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.41.0
4
+ version: 5.42.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian O'Connell