33#include " applicationInternal/hardware/hardwarePresenter.h"
44#include " device_appleTV.h"
55
6- #if (ENABLE_HUB_COMMUNICATION == 1 )
6+ #if (ENABLE_HUB_COMMUNICATION > 0 )
77#include " devices/misc/device_hub_helper.h"
88#endif
99
@@ -32,22 +32,7 @@ uint16_t APPLETV_PLAY_PAUSE;
3232uint16_t APPLETV_STOP;
3333
3434void register_device_appleTV () {
35- #if (ENABLE_HUB_COMMUNICATION == 1)
36- // Register hub commands for Apple TV when Hub is enabled
37- register_hub_command (&APPLETV_POWER_ON, " APPLE_TV" , " POWER_ON" );
38- register_hub_command (&APPLETV_POWER_OFF, " APPLE_TV" , " POWER_OFF" );
39- register_hub_command (&APPLETV_PLAY_PAUSE, " APPLE_TV" , " PLAY_PAUSE" );
40- register_hub_command (&APPLETV_SKIP_FORWARD, " APPLE_TV" , " SKIP_FORWARD" );
41- register_hub_command (&APPLETV_SKIP_BACKWARD, " APPLE_TV" , " SKIP_BACKWARD" );
42- register_hub_command (&APPLETV_STOP, " APPLE_TV" , " STOP" );
43- register_hub_command (&APPLETV_UP, " APPLE_TV" , " UP" );
44- register_hub_command (&APPLETV_DOWN, " APPLE_TV" , " DOWN" );
45- register_hub_command (&APPLETV_RIGHT, " APPLE_TV" , " RIGHT" );
46- register_hub_command (&APPLETV_LEFT, " APPLE_TV" , " LEFT" );
47- register_hub_command (&APPLETV_SELECT, " APPLE_TV" , " SELECT" );
48- register_hub_command (&APPLETV_MENU, " APPLE_TV" , " MENU" );
49- register_hub_command (&APPLETV_HOME, " APPLE_TV" , " HOME" );
50- #else
35+ #if (ENABLE_HUB_COMMUNICATION == 0)
5136 register_command (&APPLETV_UP , makeCommandData (IR, {std::to_string (IR_PROTOCOL_NEC), " 0x77E15080" }));
5237 register_command (&APPLETV_DOWN , makeCommandData (IR, {std::to_string (IR_PROTOCOL_NEC), " 0x77E13080" }));
5338 register_command (&APPLETV_LEFT , makeCommandData (IR, {std::to_string (IR_PROTOCOL_NEC), " 0x77E19080" }));
@@ -65,5 +50,20 @@ void register_device_appleTV() {
6550
6651 register_command (&APPLETV_MENU , makeCommandData (IR, {std::to_string (IR_PROTOCOL_NEC), " 0x77E1C080" }));
6752 register_command (&APPLETV_HOME , makeCommandData (IR, {std::to_string (IR_PROTOCOL_NEC), " 0xA7E10280:32:1" })); // Code + kNECBits + 1 repeat
53+ #else
54+ // Register hub commands for Apple TV when Hub is enabled
55+ register_hub_command (&APPLETV_POWER_ON, " APPLE_TV" , " POWER_ON" );
56+ register_hub_command (&APPLETV_POWER_OFF, " APPLE_TV" , " POWER_OFF" );
57+ register_hub_command (&APPLETV_PLAY_PAUSE, " APPLE_TV" , " PLAY_PAUSE" );
58+ register_hub_command (&APPLETV_SKIP_FORWARD, " APPLE_TV" , " SKIP_FORWARD" );
59+ register_hub_command (&APPLETV_SKIP_BACKWARD, " APPLE_TV" , " SKIP_BACKWARD" );
60+ register_hub_command (&APPLETV_STOP, " APPLE_TV" , " STOP" );
61+ register_hub_command (&APPLETV_UP, " APPLE_TV" , " UP" );
62+ register_hub_command (&APPLETV_DOWN, " APPLE_TV" , " DOWN" );
63+ register_hub_command (&APPLETV_RIGHT, " APPLE_TV" , " RIGHT" );
64+ register_hub_command (&APPLETV_LEFT, " APPLE_TV" , " LEFT" );
65+ register_hub_command (&APPLETV_SELECT, " APPLE_TV" , " SELECT" );
66+ register_hub_command (&APPLETV_MENU, " APPLE_TV" , " MENU" );
67+ register_hub_command (&APPLETV_HOME, " APPLE_TV" , " HOME" );
6868 #endif
6969}
0 commit comments