QAlphaCloud
0.0.1
Qt bindings for Alpha Cloud
|
Cumulative daily energy information. More...
#include <onedateenergy.h>
Inherits QObject.
Public Slots | |
bool | reload () |
(Re)load data More... | |
bool | forceReload () |
Force a reload. More... | |
void | reset () |
Reset object. More... | |
Public Member Functions | |
OneDateEnergy (QObject *parent=nullptr) | |
Creates a OneDateEnergy instance. More... | |
OneDateEnergy (Connector *connector, const QString &serialNumber, const QDate &date, QObject *parent=nullptr) | |
Creates a OneDateEnergy intsance. More... | |
Q_REQUIRED_RESULT Connector * | connector () const |
void | setConnector (Connector *connector) |
Q_SIGNAL void | connectorChanged (Connector *connector) |
Q_REQUIRED_RESULT QString | serialNumber () const |
void | setSerialNumber (const QString &serialNumber) |
Q_SIGNAL void | serialNumberChanged (const QString &serialNumber) |
Q_REQUIRED_RESULT QDate | date () const |
void | setDate (const QDate &date) |
void | resetDate () |
Q_SIGNAL void | dateChanged (const QDate &date) |
Q_REQUIRED_RESULT bool | cached () const |
void | setCached (bool cached) |
Q_SIGNAL void | cachedChanged (bool cached) |
Q_REQUIRED_RESULT int | totalLoad () const |
Q_SIGNAL void | totalLoadChanged (int totalLoad) |
Q_REQUIRED_RESULT int | photovoltaic () const |
Q_SIGNAL void | photovoltaicChanged (int photovoltaic) |
Q_REQUIRED_RESULT int | input () const |
Q_SIGNAL void | inputChanged (int input) |
Q_REQUIRED_RESULT int | output () const |
Q_SIGNAL void | outputChanged (int output) |
Q_REQUIRED_RESULT int | charge () const |
Q_SIGNAL void | chargeChanged (int charge) |
Q_REQUIRED_RESULT int | discharge () const |
Q_SIGNAL void | dischargeChanged (int discharge) |
Q_REQUIRED_RESULT int | gridCharge () const |
Q_SIGNAL void | gridChargeChanged (int gridCharge) |
Q_REQUIRED_RESULT QJsonObject | rawJson () const |
Q_SIGNAL void | rawJsonChanged () |
Q_REQUIRED_RESULT bool | valid () const |
Q_SIGNAL void | validChanged (bool valid) |
Q_REQUIRED_RESULT QAlphaCloud::RequestStatus | status () const |
Q_SIGNAL void | statusChanged (QAlphaCloud::RequestStatus status) |
QAlphaCloud::ErrorCode | error () const |
Q_SIGNAL void | errorChanged (QAlphaCloud::ErrorCode error) |
QString | errorString () const |
Q_SIGNAL void | errorStringChanged (const QString &errorString) |
Properties | |
QAlphaCloud::Connector * | connector |
The connector to use. | |
QString | serialNumber |
The serial number. More... | |
QDate | date |
The date. More... | |
bool | cached |
Cache data. More... | |
int | photovoltaic |
Photovoltaic production in Wh. | |
int | totalLoad |
Total load in Wh. | |
int | input |
Power input form grid in Wh. | |
int | output |
Power output to the grid in Wh. | |
int | charge |
Energy charged into the battery in Wh. | |
int | discharge |
Energy discharged from the battery in Wh. | |
int | gridCharge |
Battery charge from grid in Wh. More... | |
QJsonObject | rawJson |
Raw JSON. More... | |
bool | valid |
Whether this object contains data. More... | |
QAlphaCloud::RequestStatus | status |
The current request status. | |
QAlphaCloud::ErrorCode | error |
The error, if any. More... | |
QString | errorString |
The error string, if any. More... | |
Cumulative daily energy information.
Provides cumulative information about a given date.
Wraps the /getOneDateEnergy
API endpoint.
|
explicit |
Creates a OneDateEnergy instance.
parent | The owner |
QAlphaCloud::OneDateEnergy::OneDateEnergy | ( | Connector * | connector, |
const QString & | serialNumber, | ||
const QDate & | date, | ||
QObject * | parent = nullptr |
||
) |
Creates a OneDateEnergy intsance.
connector | The connector |
serialNumber | The serial number of the storage system whose data should be queried |
date | The date for which to query the data |
parent | The owner |
|
slot |
Force a reload.
Reloads the data, ignoring the cache.
|
slot |
(Re)load data
In QML, this is done automatically on component completion if the active property (not documented here) is true, which is the default.
|
slot |
Reset object.
This clears all data and resets the object back to its initial state.
|
readwrite |
Cache data.
Whether to cache the returned data, default is true.
This allows for quicker navigation between dates when they have been loaded once and reduces network traffic.
Data from the current day is never cached as data is collected throughout the day.
|
readwrite |
The date.
The date for which to query the data.
|
read |
The error, if any.
There can still be valid data in this object from a previous successful request.
|
read |
The error string, if any.
|
read |
Battery charge from grid in Wh.
How many Wh have been fed from the grid into the battery.
|
read |
Raw JSON.
The raw JSON returned by the API, useful for extracting data that isn't provided through the API yet.
|
readwrite |
The serial number.
The serial number of the storage system whose data should be queried.
|
read |
Whether this object contains data.
This is independent of the status. The status can be QAlphaCloud::Error when a subsequent request fails but any data isn't cleared unless new data is loaded successfully.