From 236d79de721206604aed6b29fa095aa26d9e04ed Mon Sep 17 00:00:00 2001 From: vlastahajek Date: Thu, 16 Apr 2020 23:20:43 +0200 Subject: [PATCH] fix: Fixing microsecond precision constant for v1 --- src/InfluxDbClient.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/InfluxDbClient.cpp b/src/InfluxDbClient.cpp index 818c1ab..b94228a 100644 --- a/src/InfluxDbClient.cpp +++ b/src/InfluxDbClient.cpp @@ -57,10 +57,10 @@ static String escapeKey(String key); static String escapeValue(const char *value); static String escapeJSONString(String &value); -static String precisionToString(WritePrecision precision) { +static String precisionToString(WritePrecision precision, uint8_t version = 2) { switch(precision) { case WritePrecision::US: - return "us"; + return version==1?"u":"us"; case WritePrecision::MS: return "ms"; case WritePrecision::NS: @@ -266,7 +266,7 @@ void InfluxDBClient::setUrls() { } } if(_writePrecision != WritePrecision::NoTime) { - _writeUrl += String("&precision=") + precisionToString(_writePrecision); + _writeUrl += String("&precision=") + precisionToString(_writePrecision, _dbVersion); } }