Class: OpenHAB::Core::Items::PlayerItem

Inherits:
GenericItem show all
Defined in:
lib/openhab/core/items/player_item.rb

Overview

A PlayerItem allows control of a player, e.g. an audio player.

Examples:

Start playing on a player item

Chromecast.play

Check if a player is paused

logger.warn("#{item.name} is paused") if Chromecast.paused?

Constant Summary

Constants included from Semantics

Semantics::Equipment, Semantics::Location, Semantics::Point, Semantics::Property, Semantics::Tag

Instance Attribute Summary collapse

Attributes inherited from GenericItem

#category, #formatted_state, #label, #name, #raw_state, #tags

Attributes included from Semantics

#equipment, #equipment_type, #location, #location_type, #point_type, #property_type, #semantic_type

Attributes included from Item

#accepted_command_types, #accepted_data_types, #all_groups, #channel, #channel_uid, #channel_uids, #channels, #groups, #links, #metadata, #name, #provider, #thing, #things

Method Summary

Methods inherited from GenericItem

#command, #modify, #null?, #refresh, #state?, #time_series=, #undef?, #update

Methods included from Semantics

add, #equipment?, #location?, lookup, #point?, #points, remove, #semantic?, tags

Methods included from Item

#color_item?, #contact_item?, #date_time_item?, #dimmer_item?, #group_item?, #image_item?, #inspect, #link, #location_item?, #member_of?, #number_item?, #player_item?, #rollershutter_item?, #string_item?, #switch_item?, #tagged?, #to_s, #unlink

Methods included from DSL::Items::TimedCommand

#command

Methods included from Persistence

#average_between, #average_since, #changed_between?, #changed_since?, #count_between, #count_since, #count_state_changes_between, #count_state_changes_since, #delta_between, #delta_since, #deviation_between, #deviation_since, #evolution_rate, #historic_state, #last_update, #maximum_between, #maximum_since, #minimum_between, #minimum_since, #persist, #previous_state, #sum_between, #sum_since, #updated_between?, #updated_since?, #variance_between, #variance_since

Methods included from DSL::Items::Ensure::Ensurable

#ensure

Instance Attribute Details

#statePlayPauseType, ... (readonly)



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/openhab/core/items/player_item.rb', line 21

class PlayerItem < GenericItem
  # @!method play?
  #   Check if the item state == {PLAY}
  #   @return [true,false]

  # @!method paused?
  #   Check if the item state == {PAUSE}
  #   @return [true,false]

  # @!method rewinding?
  #   Check if the item state == {REWIND}
  #   @return [true,false]

  # @!method fast_forwarding?
  #   Check if the item state == {FASTFORWARD}
  #   @return [true,false]

  # @!method play
  #   Send the {PLAY} command to the item
  #   @return [PlayerItem] `self`

  # @!method play!
  #   Send the {PLAY} command to the item, even when {OpenHAB::DSL.ensure_states! ensure_states!} is in effect.
  #   @return [PlayerItem] `self`

  # @!method pause
  #   Send the {PAUSE} command to the item
  #   @return [PlayerItem] `self`

  # @!method pause!
  #   Send the {PAUSE} command to the item, even when {OpenHAB::DSL.ensure_states! ensure_states!} is in effect.
  #   @return [PlayerItem] `self`

  # @!method rewind
  #   Send the {REWIND} command to the item
  #   @return [PlayerItem] `self`

  # @!method rewind!
  #   Send the {REWIND} command to the item, even when {OpenHAB::DSL.ensure_states! ensure_states!} is in effect.
  #   @return [PlayerItem] `self`

  # @!method fast_forward
  #   Send the {FASTFORWARD} command to the item
  #   @return [PlayerItem] `self`

  # @!method fast_forward!
  #   Send the {FASTFORWARD} command to the item, even when
  #     {OpenHAB::DSL.ensure_states! ensure_states!} is in effect.
  #   @return [PlayerItem] `self`

  # @!method next
  #   Send the {NEXT} command to the item
  #   @return [PlayerItem] `self`

  # @!method previous
  #   Send the {PREVIOUS} command to the item
  #   @return [PlayerItem] `self`
end