-
Notifications
You must be signed in to change notification settings - Fork 7
/
HomeAssistantTVAndroidMediaPlayer.cpp
47 lines (42 loc) · 1.38 KB
/
HomeAssistantTVAndroidMediaPlayer.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
#include "HomeAssistantTVAndroidMediaPlayer.h"
#include "esphome/core/log.h"
namespace esphome {
namespace homeassistant_media_player {
static const char* const TAG = "homeassistant.media_player_android";
void HomeAssistantTVAndroidMediaPlayer::setup() {
supported_features_.push_back(TV_BACK);
supported_features_.push_back(TV_HOME);
supported_features_.push_back(MENU_HOME);
supported_features_.push_back(REMOTE_MODE);
HomeAssistantTVMediaPlayer::setup();
}
std::string HomeAssistantTVAndroidMediaPlayer::stringForRemoteCommand(
MediaPlayerTVRemoteCommand command) {
switch (command) {
case MEDIA_PLAYER_TV_COMMAND_UP:
return "DPAD_UP";
case MEDIA_PLAYER_TV_COMMAND_DOWN:
return "DPAD_DOWN";
case MEDIA_PLAYER_TV_COMMAND_LEFT:
return "DPAD_LEFT";
case MEDIA_PLAYER_TV_COMMAND_RIGHT:
return "DPAD_RIGHT";
case MEDIA_PLAYER_TV_COMMAND_SELECT:
return "DPAD_CENTER";
case MEDIA_PLAYER_TV_COMMAND_BACK:
return "BACK";
case MEDIA_PLAYER_TV_COMMAND_HOME:
return "HOME";
case MEDIA_PLAYER_TV_COMMAND_POWER:
return "power";
case MEDIA_PLAYER_TV_COMMAND_VOLUME_UP:
return "volume_up";
case MEDIA_PLAYER_TV_COMMAND_VOLUME_DOWN:
return "volume_down";
case MEDIA_PLAYER_TV_COMMAND_PAUSE:
return "pause";
}
return "";
}
} // namespace homeassistant_media_player
} // namespace esphome