A/C Keysets, Donations button
[pierogi] / keysets / lg.cpp
index 7ed8964..8133e06 100644 (file)
@@ -1,5 +1,6 @@
 #include "lg.h"
 #include "protocols/necprotocol.h"
+#include "protocols/necxprotocol.h"
 #include "protocols/rc5protocol.h"
 
 LGTV1::LGTV1(
@@ -10,7 +11,9 @@ LGTV1::LGTV1(
       LG_Make,
       index)
 {
-  threadableProtocol = new NECProtocol(guiObject, index, false, false);
+  addControlledDevice(LG_Make, "32LH301C", TV_Device);
+
+  threadableProtocol = new NECProtocol(guiObject, index, false, true);
 
 //  setPreData(0x20DF, 16);
   setPreData(0x04, 8);
@@ -266,7 +269,6 @@ LGTV2b::LGTV2b(
 }
 
 
-/*
 LGDisc1::LGDisc1(
   QObject *guiObject,
   unsigned int index)
@@ -275,20 +277,7 @@ LGDisc1::LGDisc1(
       LG_Make,
       index)
 {
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    563, 559,
-    563, 1681,
-    108234, true,
-    Extended_NEC);
-
-  threadableProtocol = np;
-
-  np->setHeaderPair(4500, 4500);
-  np->setTrailerPulse(545);
-  np->setRepeatPair(531, 1710);
-  np->setRepeatNeedsHeader(true);
+  threadableProtocol = new NECXProtocol(guiObject, index, true);
 
 //  setPreData(0x3434, 16);
   setPreData(0x2C2C, 16);
@@ -354,10 +343,8 @@ LGDisc1::LGDisc1(
   addKey("marker", Unmapped_Key, 0xB4, 8);
   addKey("sleep", Sleep_Key, 0xC2, 8);
 }
-*/
 
 
-/*
 LGDisc2::LGDisc2(
   QObject *guiObject,
   unsigned int index)
@@ -366,20 +353,7 @@ LGDisc2::LGDisc2(
       LG_Make,
       index)
 {
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    600, 550,
-    600, 1650,
-    107000, true,
-    Extended_NEC);
-
-  threadableProtocol = np;
-
-  np->setHeaderPair(4500, 4500);
-  np->setTrailerPulse(600);
-  np->setRepeatPair(600, 550);
-  np->setRepeatNeedsHeader(true);
+  threadableProtocol = new NECXProtocol(guiObject, index, true);
 
 //  setPreData(0xB4B4, 16);
   setPreData(0x2D2D, 16);
@@ -447,7 +421,6 @@ LGDisc2a::LGDisc2a(
   addKey("KEY_YELLOW", Yellow_Key, 0x7E, 8);
   addKey("KEY_BLUE", Blue_Key, 0x7F, 8);
 }
-*/
 
 
 LGVCR1::LGVCR1(
@@ -540,3 +513,23 @@ LGVCR1b::LGVCR1b(
   addKey("menu-right", Right_Key, 0x90, 8);
 }
 
+
+LGAC1::LGAC1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Air Conditioner 1",
+      LG_Make,
+      index)
+{
+  threadableProtocol = new NECProtocol(guiObject, index, true, true);
+
+  setPreData(0x6681, 16);
+
+  addKey("power", Power_Key, 0x81, 8);
+  addKey("temp up", Red_Key, 0x85, 8);
+  addKey("temp down", Blue_Key, 0x8A, 8);
+  addKey("timer", Sleep_Key, 0x90, 8);
+  addKey("fan speed", SoundMode_Key, 0x99, 8);
+  addKey("mode", PictureMode_Key, 0x9B, 8);
+}