Commit 75fd8495 authored by Sergey 'Jin' Bostandzhyan's avatar Sergey 'Jin' Bostandzhyan

Merge branch 'master' into testing

parents e3562d6c dbeac73a
......@@ -323,11 +323,14 @@ netatmo_get_token()
netatmo.refresh_token = strdup(json_object_get_string(val));
configChanged = true;
}
} else if (!strcmp(key, "expires_in")) {
} else if (!strcmp(key, "expire_in")) {
if (type == json_type_int) {
int exp = json_object_get_int(val);
g_access_token_valid_until = time(NULL) + exp - 120; // 2 minutes before expiration
vdc_report(LOG_INFO, "network: token expire_in: %d -> valid until %ld\n", exp, g_access_token_valid_until);
}
} else if (!strcmp(key, "scope")) {
// ignore
} else if (!strcmp(key, "error")) {
if (type == json_type_string) {
vdc_report(LOG_ERR, "network: token reponse contains error: %s\n", json_object_get_string(val));
......@@ -586,12 +589,18 @@ int netatmo_get_devices()
// deprecated devicelist return modules as top level array
parseModule(val, type);
} else if (!strcmp(key, "user")) {
// ignore
} else {
vdc_report(LOG_WARNING, "network: getstationsdata unknown device type \"%s\"\n", key);
vdc_report(LOG_WARNING, "network: getstationsdata unknown toplevel object \"%s\"\n", key);
}
}
}
} else if (!strcmp(key, "time_exec") || !strcmp(key, "time_server")) {
// ignore
} else {
vdc_report(LOG_WARNING, "network: getstationsdata unknown key \"%s\"\n", key);
}
......
......@@ -445,16 +445,15 @@ void vdc_getprop_cb(dsvdc_t *handle, const char *dsuid, dsvdc_property_t *proper
dsvdc_property_add_uint(property, "primaryGroup", 8);
} else if (strcmp(name, "buttonInputDescriptions") == 0) {
} else if (strcmp(name, "buttonInputSettings") == 0) {
} else if (strcmp(name, "outputDescription") == 0) {
} else if (strcmp(name, "outputSettings") == 0) {
} else if (strcmp(name, "channelDescriptions") == 0) {
} else if (strcmp(name, "channelSettings") == 0) {
} else if (strcmp(name, "channelStates") == 0) {
} else if (strcmp(name, "deviceStates") == 0) {
} else if (strcmp(name, "deviceProperties") == 0) {
} else if (strcmp(name, "customActions") == 0) {
} else if (strcmp(name, "binaryInputDescriptions") == 0) {
if ((strcmp(dev->mod->type, "NAModule1") == 0) ||
......@@ -652,7 +651,7 @@ void vdc_getprop_cb(dsvdc_t *handle, const char *dsuid, dsvdc_property_t *proper
dsvdc_property_t *sensorRequest;
dsvdc_property_get_property_by_index(query, 0, &sensorRequest);
if (dsvdc_property_get_name(sensorRequest, 0, &sensorIndex) != DSVDC_OK) {
vdc_report(LOG_WARNING, "sensorStates: could not parse index\n");
vdc_report(LOG_DEBUG, "sensorStates: no index in request\n");
idx = -1;
} else {
idx = strtol(sensorIndex, NULL, 10);
......@@ -699,7 +698,7 @@ void vdc_getprop_cb(dsvdc_t *handle, const char *dsuid, dsvdc_property_t *proper
dsvdc_property_t *sensorRequest;
dsvdc_property_get_property_by_index(query, 0, &sensorRequest);
if (dsvdc_property_get_name(sensorRequest, 0, &sensorIndex) != DSVDC_OK) {
vdc_report(LOG_WARNING, "binaryInputStates: could not parse index\n");
vdc_report(LOG_DEBUG, "binaryInputStates: no index in request\n");
idx = -1;
} else {
idx = strtol(sensorIndex, NULL, 10);
......@@ -765,6 +764,20 @@ void vdc_getprop_cb(dsvdc_t *handle, const char *dsuid, dsvdc_property_t *proper
} else if (strcmp(name, "modelUID") == 0) {
dsvdc_property_add_string(property, name, dev->mod->type);
} else if (strcmp(name, "modelVersion") == 0) {
dsvdc_property_add_string(property, name, "0");
} else if (strcmp(name, "deviceClass") == 0) {
} else if (strcmp(name, "deviceClassVersion") == 0) {
} else if (strcmp(name, "oemGuid") == 0) {
} else if (strcmp(name, "oemModelGuid") == 0) {
} else if (strcmp(name, "vendorId") == 0) {
dsvdc_property_add_string(property, name, "vendor: NetAtmo");
} else if (strcmp(name, "vendorName") == 0) {
dsvdc_property_add_string(property, name, "NetAtmo");
} else if (strcmp(name, "vendorGuid") == 0) {
char info[256];
strcpy(info, "NetAtmo vDC ");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment