Class: OpenHAB::Core::Items::Persistence::HistoricState

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/openhab/core/items/persistence.rb

Overview

A state class with an added timestamp attribute.

This wraps HistoricItem to allow implicitly treating the object as its state, and wrapping of that state into a QuantityType as necessary.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(state, historic_item) ⇒ HistoricState

Returns a new instance of HistoricState.



55
56
57
58
# File 'lib/openhab/core/items/persistence.rb', line 55

def initialize(state, historic_item)
  @historic_item = historic_item
  super(state)
end

Instance Attribute Details

#timestampZonedDateTime (readonly)

Returns:



62
63
64
# File 'lib/openhab/core/items/persistence.rb', line 62

def timestamp
  @historic_item.timestamp
end