QAlphaCloud
0.0.1
Qt bindings for Alpha Cloud
|
Live Power Data. More...
#include <lastpowerdata.h>
Inherits QObject.
Public Slots | |
bool | reload () |
(Re)load data More... | |
void | reset () |
Reset object. More... | |
Public Member Functions | |
LastPowerData (QObject *parent=nullptr) | |
Creates a LastPowerData instance. More... | |
LastPowerData (QAlphaCloud::Connector *connector, const QString &serialNumber, QObject *parent=nullptr) | |
Creates a LastPowerData intsance. More... | |
Q_REQUIRED_RESULT QAlphaCloud::Connector * | connector () const |
void | setConnector (QAlphaCloud::Connector *connector) |
Q_SIGNAL void | connectorChanged (QAlphaCloud::Connector *connector) |
Q_REQUIRED_RESULT QString | serialNumber () const |
void | setSerialNumber (const QString &serialNumber) |
Q_SIGNAL void | serialNumberChanged (const QString &serialNumber) |
Q_REQUIRED_RESULT int | photovoltaicPower () const |
Q_SIGNAL void | photovoltaicPowerChanged (int photovoltaicPower) |
Q_REQUIRED_RESULT int | currentLoad () const |
Q_SIGNAL void | currentLoadChanged (int currentLoad) |
Q_REQUIRED_RESULT int | gridPower () const |
Q_SIGNAL void | gridPowerChanged (int gridPower) |
Q_REQUIRED_RESULT int | batteryPower () const |
Q_SIGNAL void | batteryPowerChanged (int batteryPower) |
Q_REQUIRED_RESULT qreal | batterySoc () const |
Q_SIGNAL void | batterySocChanged (qreal batterySoc) |
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... | |
int | photovoltaicPower |
Photovoltaic power in W. | |
int | currentLoad |
Current load in W. | |
int | gridPower |
Grid power in W. More... | |
int | batteryPower |
Battery power in W. | |
qreal | batterySoc |
Battery state of charge in %. | |
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... | |
Live Power Data.
Provides live information.
Wraps the /getLastPowerData
API endpoint.
|
explicit |
Creates a LastPowerData instance.
parent | The owner |
QAlphaCloud::LastPowerData::LastPowerData | ( | QAlphaCloud::Connector * | connector, |
const QString & | serialNumber, | ||
QObject * | parent = nullptr |
||
) |
Creates a LastPowerData intsance.
connector | The connector |
serialNumber | The serial number of the storage system whose data should be queried |
parent | The owner |
|
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.
|
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 |
Grid power in W.
|
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.