Merge PR #60: Netatmo: fix after upstream API change, make use of new interfaces

This commit is contained in:
Jenkins 2018-12-12 14:44:54 +01:00
commit 75fa1e4e39
3 changed files with 6 additions and 6 deletions

View File

@ -137,7 +137,7 @@ void DevicePluginNetatmo::refreshData(Device *device, const QString &token)
QUrlQuery query; QUrlQuery query;
query.addQueryItem("access_token", token); query.addQueryItem("access_token", token);
QUrl url("https://api.netatmo.com/api/devicelist"); QUrl url("https://api.netatmo.com/api/getstationsdata");
url.setQuery(query); url.setQuery(query);
QNetworkReply *reply = hardwareManager()->networkManager()->get(QNetworkRequest(url)); QNetworkReply *reply = hardwareManager()->networkManager()->get(QNetworkRequest(url));
@ -214,7 +214,7 @@ Device *DevicePluginNetatmo::findIndoorDevice(const QString &macAddress)
} }
} }
} }
return 0; return nullptr;
} }
Device *DevicePluginNetatmo::findOutdoorDevice(const QString &macAddress) Device *DevicePluginNetatmo::findOutdoorDevice(const QString &macAddress)

View File

@ -58,7 +58,7 @@
"Weather", "Weather",
"Sensor" "Sensor"
], ],
"interfaces": ["temperaturesensor", "humiditysensor", "pressuresensor"], "interfaces": ["temperaturesensor", "humiditysensor", "pressuresensor", "noisesensor", "co2sensor"],
"primaryStateTypeId": "3cb25538-e463-40ae-92f9-8f34f0c06b92", "primaryStateTypeId": "3cb25538-e463-40ae-92f9-8f34f0c06b92",
"createMethods": ["auto"], "createMethods": ["auto"],
"paramTypes": [ "paramTypes": [
@ -147,7 +147,7 @@
"displayNameEvent": "noise changed", "displayNameEvent": "noise changed",
"graphRelevant": true, "graphRelevant": true,
"unit": "Dezibel", "unit": "Dezibel",
"type": "int", "type": "double",
"defaultValue": 0 "defaultValue": 0
}, },
{ {
@ -157,7 +157,7 @@
"displayNameEvent": "co2 changed", "displayNameEvent": "co2 changed",
"graphRelevant": true, "graphRelevant": true,
"unit": "PartsPerMillion", "unit": "PartsPerMillion",
"type": "int", "type": "double",
"defaultValue": 0 "defaultValue": 0
}, },
{ {

View File

@ -30,7 +30,7 @@ class NetatmoBaseStation : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit NetatmoBaseStation(const QString &name, const QString &macAddress, QObject *parent = 0); explicit NetatmoBaseStation(const QString &name, const QString &macAddress, QObject *parent = nullptr);
// Params // Params
QString name() const; QString name() const;