Module: OpenHAB::Core::Items

Defined in:
lib/openhab/core/items.rb,
lib/openhab/core/items/item.rb,
lib/openhab/core/items/proxy.rb,
lib/openhab/core/items/metadata.rb,
lib/openhab/core/items/provider.rb,
lib/openhab/core/items/registry.rb,
lib/openhab/core/items/call_item.rb,
lib/openhab/core/items/semantics.rb,
lib/openhab/core/items/color_item.rb,
lib/openhab/core/items/group_item.rb,
lib/openhab/core/items/image_item.rb,
lib/openhab/core/items/dimmer_item.rb,
lib/openhab/core/items/number_item.rb,
lib/openhab/core/items/persistence.rb,
lib/openhab/core/items/player_item.rb,
lib/openhab/core/items/string_item.rb,
lib/openhab/core/items/switch_item.rb,
lib/openhab/core/items/contact_item.rb,
lib/openhab/core/items/generic_item.rb,
lib/openhab/core/items/numeric_item.rb,
lib/openhab/core/items/location_item.rb,
lib/openhab/core/items/metadata/hash.rb,
lib/openhab/core/items/state_storage.rb,
lib/openhab/core/items/date_time_item.rb,
lib/openhab/core/items/group_function.rb,
lib/openhab/core/items/metadata/provider.rb,
lib/openhab/core/items/item_channel_links.rb,
lib/openhab/core/items/rollershutter_item.rb,
lib/openhab/core/items/semantics/provider.rb,
lib/openhab/core/items/accepted_data_types.rb,
lib/openhab/core/items/semantics/semantic_tag.rb,
lib/openhab/core/items/metadata/namespace_hash.rb,
lib/openhab/core/items/semantics/tag_class_methods.rb

Overview

Contains the core types that openHAB uses to represent items. Items have states from the Types module.

You may use an item or group name anywhere DSL (or just EntityLookup) is available, and it will automatically be loaded.

Defined Under Namespace

Modules: GroupFunction, Item, Metadata, NumericItem, Persistence, Semantics Classes: CallItem, ColorItem, ContactItem, DateTimeItem, DimmerItem, GenericItem, GroupItem, ImageItem, ItemChannelLinks, LocationItem, NumberItem, PlayerItem, Provider, Registry, RollershutterItem, StateStorage, StringItem, SwitchItem

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.import_into_global_namespaceObject

Imports all of the item classes into the global namespace for convenient access.



22
23
24
25
26
27
28
29
# File 'lib/openhab/core/items.rb', line 22

def import_into_global_namespace
  concrete_item_classes.each do |k|
    const_name = k.java_class.simple_name
    Object.const_set(const_name, k) unless Object.const_defined?(const_name)
  end
  Object.const_set(:GenericItem, GenericItem) unless Object.const_defined?(:GenericItem)
  Object.const_set(:Item, Item) unless Object.const_defined?(:Item)
end

Instance Method Details

#closed?true, false

Check if the item state == CLOSED

Returns:

  • (true, false)


# File 'lib/openhab/core/items/contact_item.rb', line 41

#fast_forwardPlayerItem

Send the FASTFORWARD command to the item

Returns:



# File 'lib/openhab/core/items/player_item.rb', line 62

#fast_forward!PlayerItem

Send the FASTFORWARD command to the item, even when ensure_states! is in effect.

Returns:



# File 'lib/openhab/core/items/player_item.rb', line 66

#fast_forwarding?true, false

Check if the item state == FASTFORWARD

Returns:

  • (true, false)


# File 'lib/openhab/core/items/player_item.rb', line 34

#nextPlayerItem

Send the NEXT command to the item

Returns:



# File 'lib/openhab/core/items/player_item.rb', line 71

#open?true, false

Check if the item state == OPEN

Returns:

  • (true, false)


# File 'lib/openhab/core/items/contact_item.rb', line 34

#pausePlayerItem

Send the PAUSE command to the item

Returns:



# File 'lib/openhab/core/items/player_item.rb', line 46

#pause!PlayerItem

Send the PAUSE command to the item, even when ensure_states! is in effect.

Returns:



# File 'lib/openhab/core/items/player_item.rb', line 50

#paused?true, false

Check if the item state == PAUSE

Returns:

  • (true, false)


# File 'lib/openhab/core/items/player_item.rb', line 26

#playPlayerItem

Send the PLAY command to the item

Returns:



# File 'lib/openhab/core/items/player_item.rb', line 38

#play!PlayerItem

Send the PLAY command to the item, even when ensure_states! is in effect.

Returns:



# File 'lib/openhab/core/items/player_item.rb', line 42

#play?true, false

Check if the item state == PLAY

Returns:

  • (true, false)


# File 'lib/openhab/core/items/player_item.rb', line 22

#previousPlayerItem

Send the PREVIOUS command to the item

Returns:



# File 'lib/openhab/core/items/player_item.rb', line 75

#rewindPlayerItem

Send the REWIND command to the item

Returns:



# File 'lib/openhab/core/items/player_item.rb', line 54

#rewind!PlayerItem

Send the REWIND command to the item, even when ensure_states! is in effect.

Returns:



# File 'lib/openhab/core/items/player_item.rb', line 58

#rewinding?true, false

Check if the item state == REWIND

Returns:

  • (true, false)


# File 'lib/openhab/core/items/player_item.rb', line 30