ソースを参照

flip in UDP protocol instead of globally (UDP protocol is backwards)

Chris Mullins 8 年 前
コミット
7c4f2af8c4
共有2 個のファイルを変更した3 個の追加2 個の削除を含む
  1. 1 1
      lib/MiLight/RgbCctPacketFormatter.cpp
  2. 2 1
      lib/Udp/V6MiLightUdpServer.cpp

+ 1 - 1
lib/MiLight/RgbCctPacketFormatter.cpp

@@ -60,7 +60,7 @@ void RgbCctPacketFormatter::updateTemperature(uint8_t value) {
 }
 
 void RgbCctPacketFormatter::updateSaturation(uint8_t value) {
-  uint8_t remapped = 0x71 - value;
+  uint8_t remapped = value + 0xD;
   command(RGB_CCT_SATURATION, remapped);
 }
   

+ 2 - 1
lib/Udp/V6MiLightUdpServer.cpp

@@ -127,6 +127,7 @@ void V6MiLightUdpServer::sendResponse(uint16_t sessionId, uint8_t* responseBuffe
 }
 
 bool V6MiLightUdpServer::handleV1BulbCommand(uint8_t group, uint32_t _cmd, uint32_t _arg) {
+  // Makes more sense to use V5 protocol for now.
 }
 
 bool V6MiLightUdpServer::handleV2BulbCommand(uint8_t group, uint32_t _cmd, uint32_t _arg) {
@@ -159,7 +160,7 @@ bool V6MiLightUdpServer::handleV2BulbCommand(uint8_t group, uint32_t _cmd, uint3
       break;
       
     case V2_SATURATION:
-      client->updateSaturation(arg);
+      client->updateSaturation(100 - arg);
       break;
       
     default: