add valid until to awattar plugin

This commit is contained in:
Simon Stürz 2015-10-09 17:41:14 +02:00 committed by Michael Zanetti
parent 7682697c46
commit 9152a57298
3 changed files with 11 additions and 1 deletions

View File

@ -19,3 +19,4 @@ usr/lib/guh/plugins/libguh_deviceplugintune.so
usr/lib/guh/plugins/libguh_devicepluginudpcommander.so
usr/lib/guh/plugins/libguh_devicepluginkodi.so
usr/lib/guh/plugins/libguh_devicepluginelgato.so
usr/lib/guh/plugins/libguh_devicepluginawattar.so

View File

@ -29,7 +29,7 @@
In order to use this plugin you need to enter the access token from your energy provider. You can find more
information about you accesstoken \l{https://www.awattar.com/api-unser-datenfeed}{here}.
The data will be fetched every hour. The API allows you a maximum of 100 calls per day.
The data will be updated every hour. The API allows a maximum of 100 calls per day.
\chapter Plugin properties
Following JSON file contains the definition and the description of all available \l{DeviceClass}{DeviceClasses}
@ -146,6 +146,7 @@ void DevicePluginAwattar::processData(Device *device, const QVariantMap &data, c
qCDebug(dcAwattar) << "end :" << endTime.toString();
qCDebug(dcAwattar) << "price :" << marketPrice << elementMap.value("unit").toString();
device->setStateValue(currentMarketPriceStateTypeId, marketPrice);
device->setStateValue(validUntilStateTypeId, endTime.toLocalTime().toTime_t());
}
}

View File

@ -33,6 +33,14 @@
"type": "double",
"unit": "EuroPerMegaWattHour",
"defaultValue": 0
},
{
"id": "d5a8a176-aca0-45b1-b043-95c43750f383",
"idName": "validUntil",
"name": "valid until",
"unit": "UnixTime",
"type": "int",
"defaultValue": 0
}
]
}