* Send repeat * Repeat commands should be sent in a 110 ms raster. * @param aCommand one of LG_COMMAND_OFF, LG_COMMAND_ON etc. */
| 97 | * @param aCommand one of LG_COMMAND_OFF, LG_COMMAND_ON etc. |
| 98 | */ |
| 99 | bool Aircondition_LG::sendCommandAndParameter(char aCommand, int aParameter) { |
| 100 | // Commands without parameter |
| 101 | switch (aCommand) { |
| 102 | case LG_COMMAND_OFF: // off |
| 103 | sendIRCommand(LG_POWER_DOWN); |
| 104 | PowerIsOn = false; |
| 105 | return true; |
| 106 | |
| 107 | case LG_COMMAND_ON: // on |
| 108 | PowerIsOn = false; // set to false in order to suppress on bit |
| 109 | sendTemperatureFanSpeedAndMode(); |
| 110 | return true; |
| 111 | |
| 112 | case LG_COMMAND_JET: |
| 113 | DEBUG_PRINTLN(F("Send jet on")); |
| 114 | sendIRCommand(LG_JET_ON); |
| 115 | return true; |
| 116 | |
| 117 | case LG_COMMAND_LIGHT: |
| 118 | sendIRCommand(LG_LIGHT); |
| 119 | return true; |
| 120 | |
| 121 | case LG_COMMAND_CLEAR_ALL: |
| 122 | sendIRCommand(LG_CLEAR_ALL); |
| 123 | return true; |
| 124 | |
| 125 | case LG_COMMAND_TEMPERATURE_PLUS: |
| 126 | if (18 <= Temperature && Temperature <= 29) { |
| 127 | Temperature++; |
| 128 | sendTemperatureFanSpeedAndMode(); |
| 129 | } else { |
| 130 | return false; |
| 131 | } |
| 132 | return true; |
| 133 | |
| 134 | case LG_COMMAND_TEMPERATURE_MINUS: |
| 135 | if (19 <= Temperature && Temperature <= 30) { |
| 136 | Temperature--; |
| 137 | sendTemperatureFanSpeedAndMode(); |
| 138 | } else { |
| 139 | return false; |
| 140 | } |
| 141 | return true; |
| 142 | |
| 143 | } |
| 144 | |
| 145 | PowerIsOn = true; |
| 146 | |
| 147 | /* |
| 148 | * Now the commands which require a parameter |
| 149 | */ |
| 150 | if (aParameter < 0) { |
| 151 | DEBUG_PRINT(F("Error: Parameter is less than 0")); |
| 152 | return false; |
| 153 | } |
| 154 | switch (aCommand) { |
| 155 | |
| 156 | case LG_COMMAND_MODE: |
nothing calls this directly
no outgoing calls
no test coverage detected