Class: KodiClient::Methods::Input

Inherits:
KodiMethod show all
Defined in:
lib/kodi_client/methods/input.rb

Overview

contains all Kodi Input methods

Constant Summary collapse

BACK =
'Input.Back'
CONTEXT_MENU =
'Input.ContextMenu'
DOWN =
'Input.Down'
EXECUTE_ACTION =
'Input.ExecuteAction'
HOME =
'Input.Home'
INFO =
'Input.Info'
LEFT =
'Input.Left'
RIGHT =
'Input.Right'
SELECT =
'Input.Select'
SEND_TEXT =
'Input.SendText'
SHOW_CODEC =
'Input.ShowCodec'
SHOW_OSD =
'Input.ShowOSD'
SHOW_PLAYER_PROCESS_INFO =
'Input.ShowPlayerProcessInfo'
UP =
'Input.Up'

Instance Method Summary collapse

Methods inherited from KodiMethod

#apply_options, #invoke_api

Instance Method Details

#back(kodi_id = 1) ⇒ Object



23
24
25
26
27
# File 'lib/kodi_client/methods/input.rb', line 23

def back(kodi_id = 1)
  request = KodiRequest.new(kodi_id, BACK, {})
  json = invoke_api(request)
  KodiResponse.new(json)
end

#context_menu(kodi_id = 1) ⇒ Object



29
30
31
32
33
# File 'lib/kodi_client/methods/input.rb', line 29

def context_menu(kodi_id = 1)
  request = KodiRequest.new(kodi_id, CONTEXT_MENU, {})
  json = invoke_api(request)
  KodiResponse.new(json)
end

#down(kodi_id = 1) ⇒ Object



35
36
37
38
39
# File 'lib/kodi_client/methods/input.rb', line 35

def down(kodi_id = 1)
  request = KodiRequest.new(kodi_id, DOWN, {})
  json = invoke_api(request)
  KodiResponse.new(json)
end

#execute_action(action = Types::Input::InputAction::BACK, kodi_id = 1) ⇒ Object



41
42
43
44
45
# File 'lib/kodi_client/methods/input.rb', line 41

def execute_action(action = Types::Input::InputAction::BACK, kodi_id = 1)
  request = KodiRequest.new(kodi_id, EXECUTE_ACTION, { 'action' => action })
  json = invoke_api(request)
  KodiResponse.new(json)
end

#home(kodi_id = 1) ⇒ Object



47
48
49
50
51
# File 'lib/kodi_client/methods/input.rb', line 47

def home(kodi_id = 1)
  request = KodiRequest.new(kodi_id, HOME, {})
  json = invoke_api(request)
  KodiResponse.new(json)
end

#info(kodi_id = 1) ⇒ Object



53
54
55
56
57
# File 'lib/kodi_client/methods/input.rb', line 53

def info(kodi_id = 1)
  request = KodiRequest.new(kodi_id, INFO, {})
  json = invoke_api(request)
  KodiResponse.new(json)
end

#left(kodi_id = 1) ⇒ Object



59
60
61
62
63
# File 'lib/kodi_client/methods/input.rb', line 59

def left(kodi_id = 1)
  request = KodiRequest.new(kodi_id, LEFT, {})
  json = invoke_api(request)
  KodiResponse.new(json)
end

#right(kodi_id = 1) ⇒ Object



65
66
67
68
69
# File 'lib/kodi_client/methods/input.rb', line 65

def right(kodi_id = 1)
  request = KodiRequest.new(kodi_id, RIGHT, {})
  json = invoke_api(request)
  KodiResponse.new(json)
end

#select(kodi_id = 1) ⇒ Object



71
72
73
74
75
# File 'lib/kodi_client/methods/input.rb', line 71

def select(kodi_id = 1)
  request = KodiRequest.new(kodi_id, SELECT, {})
  json = invoke_api(request)
  KodiResponse.new(json)
end

#send_text(text, done = true, kodi_id = 1) ⇒ Object



77
78
79
80
81
# File 'lib/kodi_client/methods/input.rb', line 77

def send_text(text, done = true, kodi_id = 1)
  request = KodiRequest.new(kodi_id, SEND_TEXT, { 'text' => text, 'done' => done})
  json = invoke_api(request)
  KodiResponse.new(json)
end

#show_codec(kodi_id = 1) ⇒ Object



83
84
85
86
87
# File 'lib/kodi_client/methods/input.rb', line 83

def show_codec(kodi_id = 1)
  request = KodiRequest.new(kodi_id, SHOW_CODEC, {})
  json = invoke_api(request)
  KodiResponse.new(json)
end

#show_osd(kodi_id = 1) ⇒ Object



89
90
91
92
93
# File 'lib/kodi_client/methods/input.rb', line 89

def show_osd(kodi_id = 1)
  request = KodiRequest.new(kodi_id, SHOW_OSD, {})
  json = invoke_api(request)
  KodiResponse.new(json)
end

#show_player_process_info(kodi_id = 1) ⇒ Object



95
96
97
98
99
# File 'lib/kodi_client/methods/input.rb', line 95

def show_player_process_info(kodi_id = 1)
  request = KodiRequest.new(kodi_id, SHOW_PLAYER_PROCESS_INFO, {})
  json = invoke_api(request)
  KodiResponse.new(json)
end

#up(kodi_id = 1) ⇒ Object



101
102
103
104
105
# File 'lib/kodi_client/methods/input.rb', line 101

def up(kodi_id = 1)
  request = KodiRequest.new(kodi_id, UP, {})
  json = invoke_api(request)
  KodiResponse.new(json)
end