changeset 283:b464d6545388

looks like the bulbs aren't implementing that ambient light sensor thing at all The original bulbs are returning 0 and the gu10 1.0, I didn't try the white 800
author Louis Opter <kalessin@kalessin.fr>
date Wed, 26 Aug 2015 20:15:09 -0700
parents 763fb2687ed2
children 22669e12cdd1
files add_ambient_light_sensor_support.patch
diffstat 1 files changed, 11 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/add_ambient_light_sensor_support.patch	Wed Aug 26 20:04:30 2015 -0700
+++ b/add_ambient_light_sensor_support.patch	Wed Aug 26 20:15:09 2015 -0700
@@ -1,27 +1,9 @@
 # HG changeset patch
-# Parent  318b14b3d86d3f89663ea25b158abbd91cfcb3ed
+# Parent  460894a536a1797814b7d85a6782a8542d161ba7
 Add support for the ambient light sensor
 
 As well as a bunch of LIFX packet types definitions.
 
-diff --git a/core/proto.c b/core/proto.c
---- a/core/proto.c
-+++ b/core/proto.c
-@@ -218,10 +218,12 @@
-                         "\"site\":\"%s\","
-                         "\"url\":\"tcp://[%s]:%hu\","
-                         "\"latency\":%ju"
--                    "}",
-+                    "},"
-+                    "\"sensors\":{\"ambient_light\":%f}",
-             bulb_addr, site_addr,
-             bulb->gw->ip_addr, bulb->gw->port,
--            (uintmax_t)LGTD_LIFX_GATEWAY_LATENCY(bulb->gw)
-+            (uintmax_t)LGTD_LIFX_GATEWAY_LATENCY(bulb->gw),
-+            bulb->ambient_light
-         );
- 
- #define PRINT_LIFX_FW_TIMESTAMPS(fw_info, built_at_buf, installed_at_buf)       \
 diff --git a/lifx/bulb.c b/lifx/bulb.c
 --- a/lifx/bulb.c
 +++ b/lifx/bulb.c
@@ -65,6 +47,15 @@
      gw->pending_refresh_req = true;
  }
  
+@@ -856,7 +858,7 @@
+     assert(gw && hdr && pkt);
+ 
+     char addr[LGTD_LIFX_ADDR_STRLEN];
+-    lgtd_info(
++    lgtd_debug(
+         "BULB_LABEL <-- [%s]:%hu - %s label=%.*s",
+         gw->ip_addr, gw->port,
+         LGTD_IEEE8023MACTOA(hdr->target.device_addr, addr),
 @@ -867,3 +869,24 @@
          gw, hdr->target.device_addr, lgtd_lifx_bulb_set_label, pkt->label
      );
@@ -78,7 +69,7 @@
 +    assert(gw && hdr && pkt);
 +
 +    char addr[LGTD_LIFX_ADDR_STRLEN];
-+    lgtd_info(
++    lgtd_debug(
 +        "AMBIENT_LIGHT <-- [%s]:%hu - %s ambient_light=%flx",
 +        gw->ip_addr, gw->port,
 +        LGTD_IEEE8023MACTOA(hdr->target.device_addr, addr),