Also subscribe to the "sleep" Fitbit collection.
[kraftakt.git] / gfitsync.go
index 61e9107..7f28bb0 100644 (file)
@@ -130,6 +130,10 @@ func fitbitGrantHandler(ctx context.Context, w http.ResponseWriter, r *http.Requ
                return fmt.Errorf("c.Subscribe() = %v", err)
        }
 
+       if err := c.Subscribe(ctx, "sleep"); err != nil {
+               return fmt.Errorf("c.Subscribe() = %v", err)
+       }
+
        redirectURL := r.URL
        redirectURL.Path = "/"
        redirectURL.RawQuery = ""