aboutsummaryrefslogtreecommitdiffstats
path: root/binding/afm-weather-binding.c
diff options
context:
space:
mode:
Diffstat (limited to 'binding/afm-weather-binding.c')
-rw-r--r--binding/afm-weather-binding.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/binding/afm-weather-binding.c b/binding/afm-weather-binding.c
index e2094c0..1103722 100644
--- a/binding/afm-weather-binding.c
+++ b/binding/afm-weather-binding.c
@@ -223,8 +223,16 @@ static void subscribe(struct afb_req request)
const char *value = afb_req_value(request, "value");
if (value && !strcasecmp(value, "weather")) {
+ json_object *jresp = NULL;
+
afb_req_subscribe(request, weather_event);
afb_req_success(request, NULL, NULL);
+
+ jresp = json_tokener_parse(data.buffer);
+ if (jresp) {
+ json_object_object_add(jresp, "url", json_object_new_string(data.url));
+ afb_event_push(weather_event, jresp);
+ }
return;
}