Skip to content

Commit

Permalink
corrected "Basket" to "Bucket"
Browse files Browse the repository at this point in the history
  • Loading branch information
CaCO3 committed Nov 20, 2023
1 parent fe85ca8 commit 4d09566
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
10 changes: 5 additions & 5 deletions code/components/jomjol_flowcontroll/ClassFlowInfluxDBv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static const char* TAG = "INFLUXDBV2";
void ClassFlowInfluxDBv2::SetInitialParameter(void)
{
uri = "";
basket = "";
bucket = "";
dborg = "";
dbtoken = "";
// dbfield = "";
Expand Down Expand Up @@ -109,21 +109,21 @@ bool ClassFlowInfluxDBv2::ReadParameter(FILE* pfile, string& aktparamgraph)
{
handleMeasurement(splitted[0], splitted[1]);
}
if (((toUpper(splitted[0]) == "BASKET")) && (splitted.size() > 1))
if (((toUpper(splitted[0]) == "BUCKET")) && (splitted.size() > 1))
{
this->basket = splitted[1];
this->bucket = splitted[1];
}
}

printf("uri: %s\n", uri.c_str());
printf("org: %s\n", dborg.c_str());
printf("token: %s\n", dbtoken.c_str());

if ((uri.length() > 0) && (basket.length() > 0) && (dbtoken.length() > 0) && (dborg.length() > 0))
if ((uri.length() > 0) && (bucket.length() > 0) && (dbtoken.length() > 0) && (dborg.length() > 0))
{
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "Init InfluxDB with uri: " + uri + ", org: " + dborg + ", token: *****");
// printf("vor V2 Init\n");
InfluxDB_V2_Init(uri, basket, dborg, dbtoken);
InfluxDB_V2_Init(uri, bucket, dborg, dbtoken);
// printf("nach V2 Init\n");
InfluxDBenable = true;
} else {
Expand Down
2 changes: 1 addition & 1 deletion code/components/jomjol_flowcontroll/ClassFlowInfluxDBv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ClassFlowInfluxDBv2 :
public ClassFlow
{
protected:
std::string uri, basket;
std::string uri, bucket;
std::string dborg, dbtoken, dbfield;
std::string OldValue;
ClassFlowPostProcessing* flowpostprocessing;
Expand Down
10 changes: 5 additions & 5 deletions code/components/jomjol_influxdb/interface_influxdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ std::string _influxDBUser;
std::string _influxDBPassword;

std::string _influxDB_V2_URI;
std::string _influxDB_V2_Basket;
std::string _influxDB_V2_Bucket;
std::string _influxDB_V2_Token;
std::string _influxDB_V2_Org;

static esp_err_t http_event_handler(esp_http_client_event_t *evt);

void InfluxDB_V2_Init(std::string _uri, std::string _basket, std::string _org, std::string _token)
void InfluxDB_V2_Init(std::string _uri, std::string _bucket, std::string _org, std::string _token)
{
_influxDB_V2_URI = _uri;
_influxDB_V2_Basket = _basket;
_influxDB_V2_Bucket = _bucket;
_influxDB_V2_Org = _org;
_influxDB_V2_Token = _token;
}
Expand Down Expand Up @@ -70,7 +70,7 @@ void InfluxDB_V2_Publish(std::string _measurement, std::string _key, std::string

LogFile.WriteToFile(ESP_LOG_INFO, TAG, "sending line to influxdb:" + payload);

std::string apiURI = _influxDB_V2_URI + "/api/v2/write?org=" + _influxDB_V2_Org + "&bucket=" + _influxDB_V2_Basket;
std::string apiURI = _influxDB_V2_URI + "/api/v2/write?org=" + _influxDB_V2_Org + "&bucket=" + _influxDB_V2_Bucket;
apiURI.shrink_to_fit();
http_config.url = apiURI.c_str();
ESP_LOGI(TAG, "http_config: %s", http_config.url); // Add mark on log to see when it restarted
Expand Down Expand Up @@ -183,7 +183,7 @@ void InfluxDBPublish(std::string _measurement, std::string _key, std::string _co
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "sending line to influxdb:" + payload);


// use the default retention policy of the basket
// use the default retention policy of the bucket
std::string apiURI = _influxDBURI + "/write?db=" + _influxDBDatabase;
// std::string apiURI = _influxDBURI + "/api/v2/write?bucket=" + _influxDBDatabase + "/";

Expand Down
2 changes: 1 addition & 1 deletion code/components/jomjol_influxdb/interface_influxdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void InfluxDBInit(std::string _influxDBURI, std::string _database, std::string _
void InfluxDBPublish(std::string _measurement, std::string _key, std::string _content, std::string _timestamp);

// Interface to InfluxDB v2.x
void InfluxDB_V2_Init(std::string _uri, std::string _basket, std::string _org, std::string _token);
void InfluxDB_V2_Init(std::string _uri, std::string _bucket, std::string _org, std::string _token);
void InfluxDB_V2_Publish(std::string _measurement, std::string _key, std::string _content, std::string _timestamp);


Expand Down
4 changes: 2 additions & 2 deletions code/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -650,9 +650,9 @@ void migrateConfiguration(void) {
if (isInString(configLines[i], "Fieldname")) { // It is the parameter "Fieldname"
migrated = migrated | replaceString(configLines[i], "Fieldname", "Field"); // Rename it to Field
}
/* Database got renamed to Basket! */
/* Database got renamed to Bucket! */
if (isInString(configLines[i], "Database")) { // It is the parameter "Database"
migrated = migrated | replaceString(configLines[i], "Database", "Basket"); // Rename it to Basket
migrated = migrated | replaceString(configLines[i], "Database", "Bucket"); // Rename it to Bucket
}
}

Expand Down
2 changes: 1 addition & 1 deletion sd-card/config/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ HomeassistantDiscovery = false

;[InfluxDBv2]
;Uri = undefined
;Basket = undefined
;Bucket = undefined
;Measurement = undefined
;Org = undefined
;Token = undefined
Expand Down
12 changes: 6 additions & 6 deletions sd-card/html/edit_config_param.html
Original file line number Diff line number Diff line change
Expand Up @@ -952,13 +952,13 @@ <h4>

<tr class="InfluxDBv2Item">
<td class="indent1">
<input type="checkbox" id="InfluxDBv2_Basket_enabled" value="1" onclick = 'InvertEnableItem("InfluxDBv2", "Basket")' unchecked >
<label for=InfluxDBv2_Basket_enabled><class id="InfluxDBv2_Basket_text" style="color:black;">Basket</class></label>
<input type="checkbox" id="InfluxDBv2_Bucket_enabled" value="1" onclick = 'InvertEnableItem("InfluxDBv2", "Bucket")' unchecked >
<label for=InfluxDBv2_Bucket_enabled><class id="InfluxDBv2_Bucket_text" style="color:black;">Bucket</class></label>
</td>
<td>
<input required type="text" id="InfluxDBv2_Basket_value1">
<input required type="text" id="InfluxDBv2_Bucket_value1">
</td>
<td>$TOOLTIP_InfluxDBv2_Basket</td>
<td>$TOOLTIP_InfluxDBv2_Bucket</td>
</tr>

<tr class="InfluxDBv2Item">
Expand Down Expand Up @@ -2134,7 +2134,7 @@ <h4><input type="checkbox" id="Category_GPIO_enabled" value="1" onclick='Update
// WriteParameter(param, category, "InfluxDB", "Field", true);

WriteParameter(param, category, "InfluxDBv2", "Uri", true);
WriteParameter(param, category, "InfluxDBv2", "Basket", true);
WriteParameter(param, category, "InfluxDBv2", "Bucket", true);
// WriteParameter(param, category, "InfluxDBv2", "Measurement", true);
WriteParameter(param, category, "InfluxDBv2", "Org", true);
WriteParameter(param, category, "InfluxDBv2", "Token", true);
Expand Down Expand Up @@ -2272,7 +2272,7 @@ <h4><input type="checkbox" id="Category_GPIO_enabled" value="1" onclick='Update
ReadParameter(param, "InfluxDB", "password", true);

ReadParameter(param, "InfluxDBv2", "Uri", true);
ReadParameter(param, "InfluxDBv2", "Basket", true);
ReadParameter(param, "InfluxDBv2", "Bucket", true);
ReadParameter(param, "InfluxDBv2", "Measurement", true);
ReadParameter(param, "InfluxDBv2", "Org", true);
ReadParameter(param, "InfluxDBv2", "Token", true);
Expand Down
2 changes: 1 addition & 1 deletion sd-card/html/readconfigparam.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function ParseConfig() {
category[catname]["found"] = false;
param[catname] = new Object();
ParamAddValue(param, catname, "Uri");
ParamAddValue(param, catname, "Basket");
ParamAddValue(param, catname, "Bucket");
// ParamAddValue(param, catname, "Measurement");
ParamAddValue(param, catname, "Org");
ParamAddValue(param, catname, "Token");
Expand Down

0 comments on commit 4d09566

Please sign in to comment.