IRremoteESP8266

ir_Panasonic.h
Go to the documentation of this file.
1 // Copyright 2018 David Conran
2
6
7 // Supports:
8 // Brand: Panasonic, Model: TV (PANASONIC)
9 // Brand: Panasonic, Model: NKE series A/C (PANASONIC_AC NKE/2)
10 // Brand: Panasonic, Model: DKE series A/C (PANASONIC_AC DKE/3)
11 // Brand: Panasonic, Model: DKW series A/C (PANASONIC_AC DKE/3)
12 // Brand: Panasonic, Model: PKR series A/C (PANASONIC_AC DKE/3)
13 // Brand: Panasonic, Model: JKE series A/C (PANASONIC_AC JKE/4)
14 // Brand: Panasonic, Model: CKP series A/C (PANASONIC_AC CKP/5)
15 // Brand: Panasonic, Model: RKR series A/C (PANASONIC_AC RKR/6)
16 // Brand: Panasonic, Model: CS-ME10CKPG A/C (PANASONIC_AC CKP/5)
17 // Brand: Panasonic, Model: CS-ME12CKPG A/C (PANASONIC_AC CKP/5)
18 // Brand: Panasonic, Model: CS-ME14CKPG A/C (PANASONIC_AC CKP/5)
19 // Brand: Panasonic, Model: CS-E7PKR A/C (PANASONIC_AC DKE/2)
20 // Brand: Panasonic, Model: CS-Z9RKR A/C (PANASONIC_AC RKR/6)
21 // Brand: Panasonic, Model: CS-Z24RKR A/C (PANASONIC_AC RKR/6)
22 // Brand: Panasonic, Model: CS-YW9MKD A/C (PANASONIC_AC JKE/4)
23 // Brand: Panasonic, Model: A75C2311 remote (PANASONIC_AC CKP/5)
24 // Brand: Panasonic, Model: A75C2616-1 remote (PANASONIC_AC DKE/3)
25 // Brand: Panasonic, Model: A75C3704 remote (PANASONIC_AC DKE/3)
26 // Brand: Panasonic, Model: A75C3747 remote (PANASONIC_AC JKE/4)
27 // Brand: Panasonic, Model: CS-E9CKP series A/C (PANASONIC_AC32)
28 // Brand: Panasonic, Model: A75C2295 remote (PANASONIC_AC32)
29 // Brand: Panasonic, Model: A75C4762 remote (PANASONIC_AC RKR/6)
30
31 #ifndef IR_PANASONIC_H_
32 #define IR_PANASONIC_H_
33
34 #define __STDC_LIMIT_MACROS
35 #include <stdint.h>
36 #ifdef ARDUINO
37 #include <Arduino.h>
38 #endif
39 #include "IRremoteESP8266.h"
40 #include "IRsend.h"
41 #ifdef UNIT_TEST
42 #include "IRsend_test.h"
43 #endif
44
45 // Constants
46 const uint16_t kPanasonicFreq = 36700;
47 const uint16_t kPanasonicAcExcess = 0;
48 // Much higher than usual. See issue #540.
49 const uint16_t kPanasonicAcTolerance = 40;
50
51 const uint8_t kPanasonicAcAuto = 0; // 0b000
52 const uint8_t kPanasonicAcDry = 2; // 0b010
53 const uint8_t kPanasonicAcCool = 3; // 0b011
54 const uint8_t kPanasonicAcHeat = 4; // 0b010
55 const uint8_t kPanasonicAcFan = 6; // 0b110
56 const uint8_t kPanasonicAcFanMin = 0;
57 const uint8_t kPanasonicAcFanLow = 1;
58 const uint8_t kPanasonicAcFanMed = 2;
59 const uint8_t kPanasonicAcFanHigh = 3;
60 const uint8_t kPanasonicAcFanMax = 4;
61 const uint8_t kPanasonicAcFanAuto = 7;
62 const uint8_t kPanasonicAcFanDelta = 3;
63 const uint8_t kPanasonicAcPowerOffset = 0;
64 const uint8_t kPanasonicAcTempOffset = 1; // Bits
65 const uint8_t kPanasonicAcTempSize = 5; // Bits
66 const uint8_t kPanasonicAcMinTemp = 16; // Celsius
67 const uint8_t kPanasonicAcMaxTemp = 30; // Celsius
68 const uint8_t kPanasonicAcFanModeTemp = 27; // Celsius
69 const uint8_t kPanasonicAcQuietOffset = 0;
70 const uint8_t kPanasonicAcPowerfulOffset = 5; // 0b100000
71 // CKP & RKR models have Powerful and Quiet bits swapped.
72 const uint8_t kPanasonicAcQuietCkpOffset = kPanasonicAcPowerfulOffset;
73 const uint8_t kPanasonicAcPowerfulCkpOffset = kPanasonicAcQuietOffset;
74 const uint8_t kPanasonicAcSwingVHighest = 0x1; // 0b0001
75 const uint8_t kPanasonicAcSwingVHigh = 0x2; // 0b0010
76 const uint8_t kPanasonicAcSwingVMiddle = 0x3; // 0b0011
77 const uint8_t kPanasonicAcSwingVLow = 0x4; // 0b0100
78 const uint8_t kPanasonicAcSwingVLowest = 0x5; // 0b0101
79 const uint8_t kPanasonicAcSwingVAuto = 0xF; // 0b1111
80
81 const uint8_t kPanasonicAcSwingHMiddle = 0x6; // 0b0110
82 const uint8_t kPanasonicAcSwingHFullLeft = 0x9; // 0b1001
83 const uint8_t kPanasonicAcSwingHLeft = 0xA; // 0b1010
84 const uint8_t kPanasonicAcSwingHRight = 0xB; // 0b1011
85 const uint8_t kPanasonicAcSwingHFullRight = 0xC; // 0b1100
86 const uint8_t kPanasonicAcSwingHAuto = 0xD; // 0b1101
87 const uint8_t kPanasonicAcChecksumInit = 0xF4;
88 const uint8_t kPanasonicAcOnTimerOffset = 1;
89 const uint8_t kPanasonicAcOffTimerOffset = 2;
90 const uint8_t kPanasonicAcTimeSize = 11; // Bits
91 const uint8_t kPanasonicAcTimeOverflowSize = 3; // Bits
92 const uint16_t kPanasonicAcTimeMax = 23 * 60 + 59; // Mins since midnight.
93 const uint16_t kPanasonicAcTimeSpecial = 0x600;
94
95 const uint8_t kPanasonicAcIonFilterByte = 22; // Byte
96 const uint8_t kPanasonicAcIonFilterOffset = 0; // Bit
97
98 const uint8_t kPanasonicKnownGoodState[kPanasonicAcStateLength] = {
99 0x02, 0x20, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x06, 0x02,
100 0x20, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
101 0x00, 0x0E, 0xE0, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00};
102
104 class IRPanasonicAc {
105 public:
106 explicit IRPanasonicAc(const uint16_t pin, const bool inverted = false,
107 const bool use_modulation = true);
108 void stateReset(void);
109 #if SEND_PANASONIC_AC
110 void send(const uint16_t repeat = kPanasonicAcDefaultRepeat);
115 int8_t calibrate(void) { return _irsend.calibrate(); }
116 #endif // SEND_PANASONIC_AC
117 void begin(void);
118 void on(void);
119 void off(void);
120 void setPower(const bool on);
121 bool getPower(void);
122 void setTemp(const uint8_t temp, const bool remember = true);
123 uint8_t getTemp(void);
124 void setFan(const uint8_t fan);
125 uint8_t getFan(void);
126 void setMode(const uint8_t mode);
127 uint8_t getMode(void);
128 void setRaw(const uint8_t state[]);
129 uint8_t *getRaw(void);
130 static bool validChecksum(const uint8_t *state,
131 const uint16_t length = kPanasonicAcStateLength);
132 static uint8_t calcChecksum(const uint8_t *state,
133 const uint16_t length = kPanasonicAcStateLength);
134 void setQuiet(const bool on);
135 bool getQuiet(void);
136 void setPowerful(const bool on);
137 bool getPowerful(void);
138 void setIon(const bool on);
139 bool getIon(void);
140 void setModel(const panasonic_ac_remote_model_t model);
141 panasonic_ac_remote_model_t getModel(void);
142 void setSwingVertical(const uint8_t elevation);
143 uint8_t getSwingVertical(void);
144 void setSwingHorizontal(const uint8_t direction);
145 uint8_t getSwingHorizontal(void);
146 static uint16_t encodeTime(const uint8_t hours, const uint8_t mins);
147 uint16_t getClock(void);
148 void setClock(const uint16_t mins_since_midnight);
149 uint16_t getOnTimer(void);
150 void setOnTimer(const uint16_t mins_since_midnight, const bool enable = true);
151 void cancelOnTimer(void);
152 bool isOnTimerEnabled(void);
153 uint16_t getOffTimer(void);
154 void setOffTimer(const uint16_t mins_since_midnight,
155 const bool enable = true);
156 void cancelOffTimer(void);
157 bool isOffTimerEnabled(void);
158 static uint8_t convertMode(const stdAc::opmode_t mode);
159 static uint8_t convertFan(const stdAc::fanspeed_t speed);
160 static uint8_t convertSwingV(const stdAc::swingv_t position);
161 static uint8_t convertSwingH(const stdAc::swingh_t position);
162 static stdAc::opmode_t toCommonMode(const uint8_t mode);
163 static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed);
164 static stdAc::swingv_t toCommonSwingV(const uint8_t pos);
165 static stdAc::swingh_t toCommonSwingH(const uint8_t pos);
166 stdAc::state_t toCommon(void);
167 String toString(void);
168 #ifndef UNIT_TEST
169
170 private:
171 IRsend _irsend;
172 #else // UNIT_TEST
173 IRsendTest _irsend;
175 #endif // UNIT_TEST
177 uint8_t remote_state[kPanasonicAcStateLength];
178 uint8_t _swingh;
179 uint8_t _temp;
180 void fixChecksum(const uint16_t length = kPanasonicAcStateLength);
181 static uint16_t _getTime(const uint8_t ptr[]);
182 static void _setTime(uint8_t * const ptr, const uint16_t mins_since_midnight,
183 const bool round_down);
184 };
185
187 union PanasonicAc32Protocol {
188 uint32_t raw;
189 struct {
190 // Byte 0
191 uint8_t :3;
192 uint8_t SwingH :1;
193 uint8_t SwingV :3;
194 uint8_t :1;
195 // Byte 1
196 uint8_t :8; // Always seems to be 0x36.
197 // Byte 2
198 uint8_t Temp :4;
199 uint8_t Fan :4;
200 // Byte 3
201 uint8_t Mode :3;
202 uint8_t PowerToggle :1; // 0 means toggle, 1 = keep the same.
203 uint8_t :4;
204 };
205 };
206
207 const uint8_t kPanasonicAc32Fan = 1; // 0b001
208 const uint8_t kPanasonicAc32Cool = 2; // 0b010
209 const uint8_t kPanasonicAc32Dry = 3; // 0b011
210 const uint8_t kPanasonicAc32Heat = 4; // 0b010
211 const uint8_t kPanasonicAc32Auto = 6; // 0b110
212
213 const uint8_t kPanasonicAc32FanMin = 2;
214 const uint8_t kPanasonicAc32FanLow = 3;
215 const uint8_t kPanasonicAc32FanMed = 4;
216 const uint8_t kPanasonicAc32FanHigh = 5;
217 const uint8_t kPanasonicAc32FanMax = 6;
218 const uint8_t kPanasonicAc32FanAuto = 0xF;
219 const uint8_t kPanasonicAc32SwingVAuto = 0x7; // 0b111
220 const uint32_t kPanasonicAc32KnownGood = 0x0AF136FC;
221
223 class IRPanasonicAc32 {
224 public:
225 explicit IRPanasonicAc32(const uint16_t pin, const bool inverted = false,
226 const bool use_modulation = true);
227 void stateReset(void);
228 #if SEND_PANASONIC_AC32
229 void send(const uint16_t repeat = kPanasonicAcDefaultRepeat);
234 int8_t calibrate(void) { return _irsend.calibrate(); }
235 #endif // SEND_PANASONIC_AC32
236 void begin(void);
237 void setPowerToggle(const bool on);
238 bool getPowerToggle(void) const;
239 void setTemp(const uint8_t temp);
240 uint8_t getTemp(void) const;
241 void setFan(const uint8_t fan);
242 uint8_t getFan(void) const;
243 void setMode(const uint8_t mode);
244 uint8_t getMode(void) const;
245 void setRaw(const uint32_t state);
246 uint32_t getRaw(void) const;
247 void setSwingVertical(const uint8_t pos);
248 uint8_t getSwingVertical(void) const;
249 void setSwingHorizontal(const bool on);
250 bool getSwingHorizontal(void) const;
251 static uint8_t convertMode(const stdAc::opmode_t mode);
252 static uint8_t convertFan(const stdAc::fanspeed_t speed);
253 static uint8_t convertSwingV(const stdAc::swingv_t position);
254 static stdAc::opmode_t toCommonMode(const uint8_t mode);
255 static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed);
256 static stdAc::swingv_t toCommonSwingV(const uint8_t pos);
257 stdAc::state_t toCommon(const stdAc::state_t *prev = NULL) const;
258 String toString(void) const;
259 #ifndef UNIT_TEST
260
261 private:
262 IRsend _irsend;
263 #else // UNIT_TEST
264 IRsendTest _irsend;
266 #endif // UNIT_TEST
268 PanasonicAc32Protocol _;
269 };
270
271 #endif // IR_PANASONIC_H_
kPanasonicAcFanAuto
const uint8_t kPanasonicAcFanAuto
Definition: ir_Panasonic.h:61
IRPanasonicAc::_getTime
static uint16_t _getTime(const uint8_t ptr[])
Get the time from a given pointer location.
Definition: ir_Panasonic.cpp:549
IRPanasonicAc
Class for handling detailed Panasonic A/C messages.
Definition: ir_Panasonic.h:104
IRPanasonicAc32::convertSwingV
static uint8_t convertSwingV(const stdAc::swingv_t position)
Convert a standard A/C vertical swing into its native setting.
Definition: ir_Panasonic.cpp:1273
IRPanasonicAc::getTemp
uint8_t getTemp(void)
Get the current temperature setting.
Definition: ir_Panasonic.cpp:392
kPanasonicAcIonFilterOffset
const uint8_t kPanasonicAcIonFilterOffset
Definition: ir_Panasonic.h:96
kPanasonicAcAuto
const uint8_t kPanasonicAcAuto
Definition: ir_Panasonic.h:51
kPanasonicAcTimeSize
const uint8_t kPanasonicAcTimeSize
Definition: ir_Panasonic.h:90
IRPanasonicAc32::setTemp
void setTemp(const uint8_t temp)
Set the desired temperature.
Definition: ir_Panasonic.cpp:1134
IRPanasonicAc::setRaw
void setRaw(const uint8_t state[])
Set the internal state from a valid code for this protocol.
Definition: ir_Panasonic.cpp:329
IRPanasonicAc32::calibrate
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Panasonic.h:234
PanasonicAc32Protocol
Native representation of a Panasonic 32-bit A/C message.
Definition: ir_Panasonic.h:187
IRPanasonicAc32::setMode
void setMode(const uint8_t mode)
Set the operating mode of the A/C.
Definition: ir_Panasonic.cpp:1153
kPanasonicAcSwingHRight
const uint8_t kPanasonicAcSwingHRight
Definition: ir_Panasonic.h:84
stdAc::swingv_t
swingv_t
Common A/C settings for Vertical Swing.
Definition: IRsend.h:74
kPanasonicAc32FanMin
const uint8_t kPanasonicAc32FanMin
Definition: ir_Panasonic.h:213
kPanasonicAcFanMin
const uint8_t kPanasonicAcFanMin
Definition: ir_Panasonic.h:56
IRPanasonicAc::getOffTimer
uint16_t getOffTimer(void)
Get the Off Timer time value.
Definition: ir_Panasonic.cpp:610
kPanasonicAcQuietOffset
const uint8_t kPanasonicAcQuietOffset
Definition: ir_Panasonic.h:69
kPanasonicAc32FanHigh
const uint8_t kPanasonicAc32FanHigh
Definition: ir_Panasonic.h:216
kPanasonicAcOffTimerOffset
const uint8_t kPanasonicAcOffTimerOffset
Definition: ir_Panasonic.h:89
kPanasonicAc32FanMed
const uint8_t kPanasonicAc32FanMed
Definition: ir_Panasonic.h:215
kPanasonicAcTolerance
const uint16_t kPanasonicAcTolerance
Definition: ir_Panasonic.h:49
kPanasonicAc32FanAuto
const uint8_t kPanasonicAc32FanAuto
Definition: ir_Panasonic.h:218
stdAc::fanspeed_t
fanspeed_t
Common A/C settings for Fan Speeds.
Definition: IRsend.h:61
kPanasonicAcExcess
const uint16_t kPanasonicAcExcess
Definition: ir_Panasonic.h:47
IRPanasonicAc::_swingh
uint8_t _swingh
Definition: ir_Panasonic.h:178
PanasonicAc32Protocol::SwingV
uint8_t SwingV
Definition: ir_Panasonic.h:193
IRPanasonicAc::convertSwingV
static uint8_t convertSwingV(const stdAc::swingv_t position)
Convert a standard A/C vertical swing into its native setting.
Definition: ir_Panasonic.cpp:693
IRPanasonicAc32::toString
String toString(void) const
Convert the current internal state into a human readable string.
Definition: ir_Panasonic.cpp:1286
kPanasonicAcPowerfulOffset
const uint8_t kPanasonicAcPowerfulOffset
Definition: ir_Panasonic.h:70
IRPanasonicAc32::convertFan
static uint8_t convertFan(const stdAc::fanspeed_t speed)
Convert a stdAc::fanspeed_t enum into it's native speed.
Definition: ir_Panasonic.cpp:1229
IRPanasonicAc32::toCommon
stdAc::state_t toCommon(const stdAc::state_t *prev=NULL) const
Convert the current internal state into its stdAc::state_t equivalent.
Definition: ir_Panasonic.cpp:1318
IRPanasonicAc::encodeTime
static uint16_t encodeTime(const uint8_t hours, const uint8_t mins)
Convert standard (military/24hr) time to nr. of minutes since midnight.
Definition: ir_Panasonic.cpp:541
kPanasonicAcTimeOverflowSize
const uint8_t kPanasonicAcTimeOverflowSize
Definition: ir_Panasonic.h:91
kPanasonicAcFanMed
const uint8_t kPanasonicAcFanMed
Definition: ir_Panasonic.h:58
IRsend.h
IRPanasonicAc::setFan
void setFan(const uint8_t fan)
Set the speed of the fan.
Definition: ir_Panasonic.cpp:464
IRPanasonicAc::getFan
uint8_t getFan(void)
Get the current fan speed setting.
Definition: ir_Panasonic.cpp:481
IRPanasonicAc::setQuiet
void setQuiet(const bool on)
Set the Quiet setting of the A/C.
Definition: ir_Panasonic.cpp:500
kPanasonicAc32Heat
const uint8_t kPanasonicAc32Heat
Definition: ir_Panasonic.h:210
IRPanasonicAc::_temp
uint8_t _temp
Definition: ir_Panasonic.h:179
IRPanasonicAc32::setRaw
void setRaw(const uint32_t state)
Set the internal state from a valid code for this protocol.
Definition: ir_Panasonic.cpp:1119
IRsend
Class for sending all basic IR protocols.
Definition: IRsend.h:237
IRsend::calibrate
int8_t calibrate(uint16_t hz=38000U)
Calculate & set any offsets to account for execution times during sending.
Definition: IRsend.cpp:207
kPanasonicAc32SwingVAuto
const uint8_t kPanasonicAc32SwingVAuto
Definition: ir_Panasonic.h:219
PanasonicAc32Protocol::PowerToggle
uint8_t PowerToggle
Definition: ir_Panasonic.h:202
IRPanasonicAc32::setPowerToggle
void setPowerToggle(const bool on)
Set the Power Toggle setting of the A/C.
Definition: ir_Panasonic.cpp:1126
IRPanasonicAc::setSwingVertical
void setSwingVertical(const uint8_t elevation)
Control the vertical swing setting.
Definition: ir_Panasonic.cpp:418
String
std::string String
Definition: IRremoteESP8266.h:1521
IRPanasonicAc::toCommonFanSpeed
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed into its stdAc equivalent.
Definition: ir_Panasonic.cpp:734
kPanasonicAcFanLow
const uint8_t kPanasonicAcFanLow
Definition: ir_Panasonic.h:57
IRPanasonicAc::setIon
void setIon(const bool on)
Set the Ion (filter) setting of the A/C.
Definition: ir_Panasonic.cpp:657
kPanasonicAcPowerfulCkpOffset
const uint8_t kPanasonicAcPowerfulCkpOffset
Definition: ir_Panasonic.h:73
kPanasonicAcSwingHAuto
const uint8_t kPanasonicAcSwingHAuto
Definition: ir_Panasonic.h:86
kPanasonicAc32FanLow
const uint8_t kPanasonicAc32FanLow
Definition: ir_Panasonic.h:214
kPanasonicAcMinTemp
const uint8_t kPanasonicAcMinTemp
Definition: ir_Panasonic.h:66
IRPanasonicAc32::setSwingHorizontal
void setSwingHorizontal(const bool on)
Control the horizontal swing setting.
Definition: ir_Panasonic.cpp:1246
kPanasonicAcPowerOffset
const uint8_t kPanasonicAcPowerOffset
Definition: ir_Panasonic.h:63
kPanasonicAcHeat
const uint8_t kPanasonicAcHeat
Definition: ir_Panasonic.h:54
IRPanasonicAc::send
void send(const uint16_t repeat=kPanasonicAcDefaultRepeat)
Send the current internal state as an IR message.
Definition: ir_Panasonic.cpp:246
IRPanasonicAc32::getSwingHorizontal
bool getSwingHorizontal(void) const
Get the current horizontal swing setting.
Definition: ir_Panasonic.cpp:1242
PanasonicAc32Protocol::Fan
uint8_t Fan
Definition: ir_Panasonic.h:199
IRPanasonicAc::getClock
uint16_t getClock(void)
Get the current clock time value.
Definition: ir_Panasonic.cpp:559
IRPanasonicAc::getPower
bool getPower(void)
Get the A/C power state of the remote.
Definition: ir_Panasonic.cpp:351
IRPanasonicAc::getQuiet
bool getQuiet(void)
Get the Quiet setting of the A/C.
Definition: ir_Panasonic.cpp:488
kPanasonicAc32KnownGood
const uint32_t kPanasonicAc32KnownGood
Cool, Auto, 16C.
Definition: ir_Panasonic.h:220
IRPanasonicAc32::toCommonMode
static stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode into its stdAc equivalent.
Definition: ir_Panasonic.cpp:1182
panasonic_ac_remote_model_t
panasonic_ac_remote_model_t
Panasonic A/C model numbers.
Definition: IRsend.h:181
IRremoteESP8266.h
stdAc::swingh_t
swingh_t
Common A/C settings for Horizontal Swing.
Definition: IRsend.h:100
IRPanasonicAc::setOffTimer
void setOffTimer(const uint16_t mins_since_midnight, const bool enable=true)
Set/Enable the Off Timer.
Definition: ir_Panasonic.cpp:620
IRPanasonicAc::toCommon
stdAc::state_t toCommon(void)
Convert the current internal state into its stdAc::state_t equivalent.
Definition: ir_Panasonic.cpp:771
IRPanasonicAc::calcChecksum
static uint8_t calcChecksum(const uint8_t *state, const uint16_t length=kPanasonicAcStateLength)
Calculate the checksum for a given state.
Definition: ir_Panasonic.cpp:232
IRPanasonicAc::convertMode
static uint8_t convertMode(const stdAc::opmode_t mode)
Convert a stdAc::opmode_t enum into its native mode.
Definition: ir_Panasonic.cpp:666
kPanasonicAcChecksumInit
const uint8_t kPanasonicAcChecksumInit
Definition: ir_Panasonic.h:87
IRPanasonicAc::_setTime
static void _setTime(uint8_t *const ptr, const uint16_t mins_since_midnight, const bool round_down)
Set the time at a given pointer location.
Definition: ir_Panasonic.cpp:566
IRPanasonicAc::getSwingVertical
uint8_t getSwingVertical(void)
Get the current vertical swing setting.
Definition: ir_Panasonic.cpp:412
kPanasonicAcDefaultRepeat
const uint16_t kPanasonicAcDefaultRepeat
Definition: IRremoteESP8266.h:1344
PanasonicAc32Protocol::Temp
uint8_t Temp
Definition: ir_Panasonic.h:198
kPanasonicAcSwingHFullRight
const uint8_t kPanasonicAcSwingHFullRight
Definition: ir_Panasonic.h:85
kPanasonicAc32Auto
const uint8_t kPanasonicAc32Auto
Definition: ir_Panasonic.h:211
kPanasonicAcSwingHLeft
const uint8_t kPanasonicAcSwingHLeft
Definition: ir_Panasonic.h:83
IRPanasonicAc::getPowerful
bool getPowerful(void)
Get the Powerful (Turbo) setting of the A/C.
Definition: ir_Panasonic.cpp:513
IRPanasonicAc::setSwingHorizontal
void setSwingHorizontal(const uint8_t direction)
Control the horizontal swing setting.
Definition: ir_Panasonic.cpp:435
IRPanasonicAc::getRaw
uint8_t * getRaw(void)
Get a PTR to the internal state/code for this protocol.
Definition: ir_Panasonic.cpp:322
IRPanasonicAc32::_
PanasonicAc32Protocol _
The state in code form.
Definition: ir_Panasonic.h:268
kPanasonicAcStateLength
const uint16_t kPanasonicAcStateLength
Definition: IRremoteESP8266.h:1340
IRPanasonicAc32::getTemp
uint8_t getTemp(void) const
Get the current desired temperature setting.
Definition: ir_Panasonic.cpp:1142
kPanasonicAcSwingHMiddle
const uint8_t kPanasonicAcSwingHMiddle
Definition: ir_Panasonic.h:81
IRPanasonicAc32::convertMode
static uint8_t convertMode(const stdAc::opmode_t mode)
Convert a stdAc::opmode_t enum into its native mode.
Definition: ir_Panasonic.cpp:1169
kPanasonicAcCool
const uint8_t kPanasonicAcCool
Definition: ir_Panasonic.h:53
IRPanasonicAc32::getSwingVertical
uint8_t getSwingVertical(void) const
Get the current vertical swing setting.
Definition: ir_Panasonic.cpp:1250
IRPanasonicAc32::IRPanasonicAc32
IRPanasonicAc32(const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
Class constructor.
Definition: ir_Panasonic.cpp:1098
kPanasonicFreq
const uint16_t kPanasonicFreq
Definition: ir_Panasonic.h:46
IRPanasonicAc32::_irsend
IRsend _irsend
Instance of the IR send class.
Definition: ir_Panasonic.h:262
IRPanasonicAc::toCommonSwingH
static stdAc::swingh_t toCommonSwingH(const uint8_t pos)
Convert a native horizontal swing postion to it's common equivalent.
Definition: ir_Panasonic.cpp:748
kPanasonicAc32Fan
const uint8_t kPanasonicAc32Fan
Definition: ir_Panasonic.h:207
IRPanasonicAc::_irsend
IRsend _irsend
Instance of the IR send class.
Definition: ir_Panasonic.h:171
IRPanasonicAc32::setSwingVertical
void setSwingVertical(const uint8_t pos)
Control the vertical swing setting.
Definition: ir_Panasonic.cpp:1254
IRPanasonicAc::setOnTimer
void setOnTimer(const uint16_t mins_since_midnight, const bool enable=true)
Set/Enable the On Timer.
Definition: ir_Panasonic.cpp:591
IRPanasonicAc::on
void on(void)
Change the power setting to On.
Definition: ir_Panasonic.cpp:356
IRPanasonicAc::IRPanasonicAc
IRPanasonicAc(const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
Class constructor.
Definition: ir_Panasonic.cpp:204
IRPanasonicAc::toString
String toString(void)
Convert the internal state into a human readable string.
Definition: ir_Panasonic.cpp:797
PanasonicAc32Protocol::Mode
uint8_t Mode
Definition: ir_Panasonic.h:201
kPanasonicAc32FanMax
const uint8_t kPanasonicAc32FanMax
Definition: ir_Panasonic.h:217
kPanasonicAcQuietCkpOffset
const uint8_t kPanasonicAcQuietCkpOffset
Definition: ir_Panasonic.h:72
kPanasonicKnownGoodState
const uint8_t kPanasonicKnownGoodState[kPanasonicAcStateLength]
Definition: ir_Panasonic.h:98
kPanasonicAcFanHigh
const uint8_t kPanasonicAcFanHigh
Definition: ir_Panasonic.h:59
kPanasonicAcSwingVAuto
const uint8_t kPanasonicAcSwingVAuto
Definition: ir_Panasonic.h:79
IRPanasonicAc32::send
void send(const uint16_t repeat=kPanasonicAcDefaultRepeat)
Send the current internal state as IR messages.
Definition: ir_Panasonic.cpp:1105
kPanasonicAcSwingVHigh
const uint8_t kPanasonicAcSwingVHigh
Definition: ir_Panasonic.h:75
IRPanasonicAc::isOnTimerEnabled
bool isOnTimerEnabled(void)
Check if the On Timer is Enabled.
Definition: ir_Panasonic.cpp:604
IRPanasonicAc::begin
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Panasonic.cpp:216
kPanasonicAc32Dry
const uint8_t kPanasonicAc32Dry
Definition: ir_Panasonic.h:209
IRPanasonicAc::fixChecksum
void fixChecksum(const uint16_t length=kPanasonicAcStateLength)
Calculate and set the checksum values for the internal state.
Definition: ir_Panasonic.cpp:239
IRPanasonicAc32::setFan
void setFan(const uint8_t fan)
Set the speed of the fan.
Definition: ir_Panasonic.cpp:1194
IRPanasonicAc::calibrate
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Panasonic.h:115
IRPanasonicAc::setPower
void setPower(const bool on)
Control the power state of the A/C unit.
Definition: ir_Panasonic.cpp:343
IRPanasonicAc32::begin
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Panasonic.cpp:1111
kPanasonicAcTempOffset
const uint8_t kPanasonicAcTempOffset
Definition: ir_Panasonic.h:64
IRPanasonicAc::setClock
void setClock(const uint16_t mins_since_midnight)
Set the current clock time value.
Definition: ir_Panasonic.cpp:580
kPanasonicAcTimeSpecial
const uint16_t kPanasonicAcTimeSpecial
Definition: ir_Panasonic.h:93
IRPanasonicAc::setMode
void setMode(const uint8_t mode)
Set the operating mode of the A/C.
Definition: ir_Panasonic.cpp:369
IRPanasonicAc32::toCommonSwingV
static stdAc::swingv_t toCommonSwingV(const uint8_t pos)
Convert a native vertical swing postion to it's common equivalent.
Definition: ir_Panasonic.cpp:1266
kPanasonicAcSwingVLow
const uint8_t kPanasonicAcSwingVLow
Definition: ir_Panasonic.h:77
IRPanasonicAc::cancelOnTimer
void cancelOnTimer(void)
Cancel the On Timer.
Definition: ir_Panasonic.cpp:600
IRPanasonicAc32::toCommonFanSpeed
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed into its stdAc equivalent.
Definition: ir_Panasonic.cpp:1215
IRPanasonicAc::getSwingHorizontal
uint8_t getSwingHorizontal(void)
Get the current horizontal swing setting.
Definition: ir_Panasonic.cpp:429
kPanasonicAcFan
const uint8_t kPanasonicAcFan
Definition: ir_Panasonic.h:55
IRPanasonicAc::off
void off(void)
Change the power setting to Off.
Definition: ir_Panasonic.cpp:359
kPanasonicAcDry
const uint8_t kPanasonicAcDry
Definition: ir_Panasonic.h:52
IRPanasonicAc32
Class for handling detailed Panasonic 32bit A/C messages.
Definition: ir_Panasonic.h:223
IRPanasonicAc::remote_state
uint8_t remote_state[kPanasonicAcStateLength]
The state in code form.
Definition: ir_Panasonic.h:177
IRPanasonicAc::cancelOffTimer
void cancelOffTimer(void)
Cancel the Off Timer.
Definition: ir_Panasonic.cpp:635
kPanasonicAcIonFilterByte
const uint8_t kPanasonicAcIonFilterByte
Definition: ir_Panasonic.h:95
IRPanasonicAc::convertFan
static uint8_t convertFan(const stdAc::fanspeed_t speed)
Convert a stdAc::fanspeed_t enum into it's native speed.
Definition: ir_Panasonic.cpp:679
kPanasonicAcSwingVMiddle
const uint8_t kPanasonicAcSwingVMiddle
Definition: ir_Panasonic.h:76
IRPanasonicAc::validChecksum
static bool validChecksum(const uint8_t *state, const uint16_t length=kPanasonicAcStateLength)
Verify the checksum is valid for a given state.
Definition: ir_Panasonic.cpp:222
kPanasonicAcFanDelta
const uint8_t kPanasonicAcFanDelta
Definition: ir_Panasonic.h:62
kPanasonicAcSwingVHighest
const uint8_t kPanasonicAcSwingVHighest
Definition: ir_Panasonic.h:74
kPanasonicAc32Cool
const uint8_t kPanasonicAc32Cool
Definition: ir_Panasonic.h:208
IRPanasonicAc::stateReset
void stateReset(void)
Reset the state of the remote to a known good state/sequence.
Definition: ir_Panasonic.cpp:209
kPanasonicAcTempSize
const uint8_t kPanasonicAcTempSize
Definition: ir_Panasonic.h:65
IRPanasonicAc::getMode
uint8_t getMode(void)
Get the operating mode setting of the A/C.
Definition: ir_Panasonic.cpp:363
IRPanasonicAc::setPowerful
void setPowerful(const bool on)
Set the Powerful (Turbo) setting of the A/C.
Definition: ir_Panasonic.cpp:525
kPanasonicAcFanModeTemp
const uint8_t kPanasonicAcFanModeTemp
Definition: ir_Panasonic.h:68
IRPanasonicAc32::getPowerToggle
bool getPowerToggle(void) const
Get the Power Toggle setting of the A/C.
Definition: ir_Panasonic.cpp:1130
kPanasonicAcFanMax
const uint8_t kPanasonicAcFanMax
Definition: ir_Panasonic.h:60
IRPanasonicAc::toCommonMode
static stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode into its stdAc equivalent.
Definition: ir_Panasonic.cpp:721
IRPanasonicAc32::getRaw
uint32_t getRaw(void) const
Get a copy of the internal state/code for this protocol.
Definition: ir_Panasonic.cpp:1115
IRPanasonicAc::isOffTimerEnabled
bool isOffTimerEnabled(void)
Check if the Off Timer is Enabled.
Definition: ir_Panasonic.cpp:639
kPanasonicAcTimeMax
const uint16_t kPanasonicAcTimeMax
Definition: ir_Panasonic.h:92
kPanasonicAcSwingHFullLeft
const uint8_t kPanasonicAcSwingHFullLeft
Definition: ir_Panasonic.h:82
IRPanasonicAc::getModel
panasonic_ac_remote_model_t getModel(void)
Get/Detect the model of the A/C.
Definition: ir_Panasonic.cpp:303
IRPanasonicAc::getIon
bool getIon(void)
Get the Ion (filter) setting of the A/C.
Definition: ir_Panasonic.cpp:645
PanasonicAc32Protocol::raw
uint32_t raw
The state in IR code form.
Definition: ir_Panasonic.h:188
IRPanasonicAc32::stateReset
void stateReset(void)
Reset the state of the remote to a known good state/sequence.
Definition: ir_Panasonic.cpp:1122
IRPanasonicAc::getOnTimer
uint16_t getOnTimer(void)
Get the On Timer time value.
Definition: ir_Panasonic.cpp:586
stdAc::state_t
Structure to hold a common A/C state.
Definition: IRsend.h:114
IRPanasonicAc::setModel
void setModel(const panasonic_ac_remote_model_t model)
Set the model of the A/C to emulate.
Definition: ir_Panasonic.cpp:253
PanasonicAc32Protocol::SwingH
uint8_t SwingH
Definition: ir_Panasonic.h:192
IRPanasonicAc32::getMode
uint8_t getMode(void) const
Get the operating mode setting of the A/C.
Definition: ir_Panasonic.cpp:1148
kPanasonicAcMaxTemp
const uint8_t kPanasonicAcMaxTemp
Definition: ir_Panasonic.h:67
IRPanasonicAc::convertSwingH
static uint8_t convertSwingH(const stdAc::swingh_t position)
Convert a standard A/C horizontal swing into its native setting.
Definition: ir_Panasonic.cpp:707
IRPanasonicAc::setTemp
void setTemp(const uint8_t temp, const bool remember=true)
Set the temperature.
Definition: ir_Panasonic.cpp:401
kPanasonicAcSwingVLowest
const uint8_t kPanasonicAcSwingVLowest
Definition: ir_Panasonic.h:78
kPanasonicAcOnTimerOffset
const uint8_t kPanasonicAcOnTimerOffset
Definition: ir_Panasonic.h:88
IRPanasonicAc::toCommonSwingV
static stdAc::swingv_t toCommonSwingV(const uint8_t pos)
Convert a native vertical swing postion to it's common equivalent.
Definition: ir_Panasonic.cpp:762
IRPanasonicAc32::getFan
uint8_t getFan(void) const
Get the current fan speed setting.
Definition: ir_Panasonic.cpp:1210
stdAc::opmode_t
opmode_t
Common A/C settings for A/C operating modes.
Definition: IRsend.h:49