Add envoy support to solar logger
This commit is contained in:
@@ -3,22 +3,29 @@
|
||||
#include <sqlite3.h>
|
||||
#include <string>
|
||||
|
||||
struct Row
|
||||
struct ZeverRow
|
||||
{
|
||||
time_t epochTime;
|
||||
std::int32_t watt;
|
||||
double kilowattPerHour;
|
||||
};
|
||||
|
||||
struct EnvoyRow
|
||||
{
|
||||
time_t epochTime;
|
||||
std::int32_t inverterCount;
|
||||
std::int32_t currentWatt;
|
||||
std::int64_t lifetimeWattHour;
|
||||
std::int64_t inverterTime;
|
||||
};
|
||||
|
||||
class Database {
|
||||
private:
|
||||
sqlite3 * connectionPtr;
|
||||
|
||||
std::string ToSqlInsertStatement(Row const & row) const;
|
||||
std::string ToSqlUpsertStatement(Row const & row) const;
|
||||
|
||||
public:
|
||||
bool Insert(Row & row);
|
||||
bool Insert(ZeverRow & row);
|
||||
bool Insert(EnvoyRow & row);
|
||||
|
||||
Database(std::string const & databasePath);
|
||||
~Database();
|
||||
|
||||
Reference in New Issue
Block a user