Skip to content

Commit f1d1353

Browse files
committed
Merge branch 'release/0.3.0'
2 parents 4d36ea1 + 7cfbecc commit f1d1353

File tree

8 files changed

+11
-12
lines changed

8 files changed

+11
-12
lines changed

.env.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ INFLUX_PORT=8086
88
INFLUX_TOKEN=my-token # With permissions to read AND write to the bucket
99
INFLUX_ORG=my-org
1010
INFLUX_BUCKET=my-bucket
11-
INFLUX_MEASUREMENT=power-splitter
1211
INFLUX_INTERVAL=3600
1312

1413
#### Sensor mapping: Map to Measurement/Field in InfluxDB

.env.test

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ INFLUX_PORT=8086
88
INFLUX_TOKEN=my-token
99
INFLUX_ORG=my-org
1010
INFLUX_BUCKET=my-bucket
11-
INFLUX_MEASUREMENT=my_power_splitter
1211
INFLUX_INTERVAL=5
1312

1413
##### Redis

lib/config.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ class Config # rubocop:disable Metrics/ClassLength
1010
:influx_token,
1111
:influx_org,
1212
:influx_bucket,
13-
:influx_measurement,
1413
:influx_interval,
1514
:redis_url,
1615
:time_zone
@@ -26,7 +25,6 @@ def initialize(env, logger: NullLogger.new)
2625
@influx_org = env.fetch('INFLUX_ORG')
2726
@influx_bucket = env.fetch('INFLUX_BUCKET')
2827
@influx_interval = [env.fetch('INFLUX_INTERVAL', '3600').to_i, 300].max
29-
@influx_measurement = env.fetch('INFLUX_MEASUREMENT', 'power_splitter')
3028
validate_url!(influx_url)
3129
logger.info "Accessing InfluxDB at #{influx_url}, bucket #{influx_bucket}"
3230

@@ -43,6 +41,10 @@ def influx_url
4341

4442
attr_reader :logger
4543

44+
def influx_measurement
45+
'power_splitter'
46+
end
47+
4648
def measurement(sensor_name)
4749
@measurement ||= {}
4850
@measurement[sensor_name] ||= splitted_sensor_name(sensor_name)&.first

spec/cassettes/influx_success.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/cassettes/last_splitter-with-records.yml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/cassettes/last_splitter-without-records.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/lib/config_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
'INFLUX_TOKEN' => 'this.is.just.an.example',
1212
'INFLUX_ORG' => 'solectrus',
1313
'INFLUX_BUCKET' => 'my-bucket',
14-
'INFLUX_MEASUREMENT' => 'my-measurement',
1514
'INFLUX_INTERVAL' => '5',
1615
###
1716
'INFLUX_SENSOR_GRID_IMPORT_POWER' => 'SENEC:grid_power_plus',

spec/lib/processor_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
expect(lines).to eq(
3434
[
35-
'my_power_splitter heatpump_power_grid=10i,house_power_grid=25i,wallbox_power_grid=15i 1641034800',
35+
'power_splitter heatpump_power_grid=10i,house_power_grid=25i,wallbox_power_grid=15i 1641034800',
3636
],
3737
)
3838
end

0 commit comments

Comments
 (0)