Skip to content

Commit

Permalink
#4: Receiver stays on when TV goes from Kodi to standby
Browse files Browse the repository at this point in the history
  • Loading branch information
ballle98 committed Jan 5, 2024
1 parent 795a279 commit ee988b7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cec-lirc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ void CECCommand(void *cbParam, const cec_command *command) {
<< " " << unsigned(command->initiator) << " -> "
<< unsigned(command->destination) << endl;
cec_power_status power;
cec_power_status tvPower;

switch (command->opcode) {
case CEC_OPCODE_STANDBY: //0x36 0f:36
Expand Down Expand Up @@ -241,12 +242,15 @@ void CECCommand(void *cbParam, const cec_command *command) {
// TV(0) -> Audio(5): give device power status (8F)
// Audio(5) --> TV(0): on
power = CECAdapter->GetDevicePowerStatus(command->destination);
tvPower = CECAdapter->GetDevicePowerStatus((cec_logical_address)CEC_DEVICE_TYPE_TV);
(logMask & CEC_LOG_DEBUG)
&& cout << "Power Status(" << CECAdapter->ToString(command->destination)
<< "): " << CECAdapter->ToString(power) << endl;
<< "): " << CECAdapter->ToString(power) << " TV Power: " <<
CECAdapter->ToString(tvPower) << endl;

if (command->destination ==
(cec_logical_address)CEC_DEVICE_TYPE_AUDIO_SYSTEM) {
if (power == CEC_POWER_STATUS_ON) {
if ((tvPower == CEC_POWER_STATUS_ON) && (power == CEC_POWER_STATUS_ON)) {
turnAudioOn();
} else if (power == CEC_POWER_STATUS_STANDBY) {
turnAudioOff();
Expand Down

0 comments on commit ee988b7

Please sign in to comment.