Skip to content

Commit

Permalink
Merge branch 'release/0.16.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ledermann committed Aug 30, 2024
2 parents ee0d5a3 + 2de9766 commit 2065924
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: bundle exec rspec

- name: Send test coverage to CodeClimate
uses: paambaati/codeclimate-action@v8.0.0
uses: paambaati/codeclimate-action@v9.0.0
if: ${{ env.CC_TEST_REPORTER_ID }}
with:
coverageCommand: true
Expand Down
3 changes: 0 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ gem 'oj'
# CSV Reading and Writing (https://github.com/ruby/csv)
gem 'csv'

# Support for encoding and decoding binary data using a Base64 representation. (https://github.com/ruby/base64)
gem 'base64'

group :development do
# Guard gem for RSpec (https://github.com/guard/guard-rspec)
gem 'guard-rspec', require: false
Expand Down
32 changes: 17 additions & 15 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ GEM
diff-lcs (1.5.1)
docile (1.4.1)
dotenv (3.1.2)
faraday (2.10.1)
faraday-net_http (>= 2.0, < 3.2)
faraday (2.11.0)
faraday-net_http (>= 2.0, < 3.4)
logger
faraday-net_http (3.1.1)
faraday-net_http (3.3.0)
net-http
faraday-net_http_persistent (2.1.0)
faraday (~> 2.5)
Expand Down Expand Up @@ -60,10 +60,12 @@ GEM
notiffany (0.1.3)
nenv (~> 0.1)
shellany (~> 0.0)
oj (3.16.4)
oj (3.16.5)
bigdecimal (>= 3.0)
parallel (1.25.1)
parser (3.3.4.0)
ostruct (>= 0.2)
ostruct (0.6.0)
parallel (1.26.3)
parser (3.3.4.2)
ast (~> 2.4.1)
racc
pry (0.14.2)
Expand All @@ -77,15 +79,15 @@ GEM
rb-inotify (0.11.1)
ffi (~> 1.0)
regexp_parser (2.9.2)
rexml (3.3.4)
rexml (3.3.6)
strscan
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.0)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.1)
rspec-expectations (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.1)
Expand All @@ -103,7 +105,7 @@ GEM
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.32.0)
rubocop-ast (1.32.1)
parser (>= 3.3.1.0)
rubocop-performance (1.21.1)
rubocop (>= 1.48.1, < 2.0)
Expand All @@ -113,7 +115,7 @@ GEM
rubocop-rspec (3.0.4)
rubocop (~> 1.61)
ruby-progressbar (1.13.0)
senec (0.16.0)
senec (0.17.2)
faraday
faraday-net_http_persistent
faraday-request-timer
Expand All @@ -125,10 +127,11 @@ GEM
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
strscan (3.1.0)
thor (1.3.1)
thor (1.3.2)
unicode-display_width (2.5.0)
uri (0.13.0)
vcr (6.2.0)
uri (0.13.1)
vcr (6.3.1)
base64
webmock (3.23.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
Expand All @@ -139,7 +142,6 @@ PLATFORMS

DEPENDENCIES
amazing_print
base64
csv
dotenv
guard-rspec
Expand All @@ -157,4 +159,4 @@ DEPENDENCIES
webmock

BUNDLED WITH
2.5.17
2.5.18
5 changes: 5 additions & 0 deletions lib/cloud_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def raw_record_hash
bat_charge_current:,
bat_voltage:,
wallbox_charge_power:,
ev_connected:,
case_temp:,
application_version:,
}.compact
Expand Down Expand Up @@ -132,6 +133,10 @@ def wallbox_charge_power
dashboard_record.dig('aktuell', 'wallbox', 'wert')&.round
end

def ev_connected
dashboard_record['electricVehicleConnected'] == 'true'
end

def grid_power_minus
dashboard_record.dig('aktuell', 'netzeinspeisung', 'wert')&.round
end
Expand Down
5 changes: 5 additions & 0 deletions lib/local_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def raw_record_hash # rubocop:disable Metrics/MethodLength,Metrics/AbcSize
bat_fuel_charge:,
bat_charge_current:,
bat_voltage:,
ev_connected:,
wallbox_charge_power:,
wallbox_charge_power0: wallbox_charge_power(0),
wallbox_charge_power1: wallbox_charge_power(1),
Expand Down Expand Up @@ -188,6 +189,10 @@ def bat_voltage
data.bat_voltage
end

def ev_connected
data.ev_connected.any?(&:positive?)
end

def wallbox_charge_power(index = nil)
if index
data.wallbox_charge_power[index].round
Expand Down
13 changes: 6 additions & 7 deletions spec/cassettes/influx-success.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions spec/cassettes/senec-local.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2065924

Please sign in to comment.