senec 0.17.2 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.DS_Store +0 -0
- data/.env +6 -0
- data/.env.test +1 -1
- data/.rspec_status +69 -0
- data/.rubocop.yml +1 -1
- data/.ruby-lsp/.gitignore +1 -0
- data/.ruby-lsp/Gemfile +6 -0
- data/.ruby-lsp/Gemfile.lock +170 -0
- data/.ruby-lsp/main_lockfile_hash +1 -0
- data/.ruby-lsp/needs_update +0 -0
- data/LICENSE +1 -1
- data/README.md +56 -56
- data/coverage/.last_run.json +5 -0
- data/coverage/.resultset.json +1367 -0
- data/coverage/.resultset.json.lock +0 -0
- data/coverage/assets/0.13.2/DataTables-1.10.20/images/sort_asc.png +0 -0
- data/coverage/assets/0.13.2/DataTables-1.10.20/images/sort_asc_disabled.png +0 -0
- data/coverage/assets/0.13.2/DataTables-1.10.20/images/sort_both.png +0 -0
- data/coverage/assets/0.13.2/DataTables-1.10.20/images/sort_desc.png +0 -0
- data/coverage/assets/0.13.2/DataTables-1.10.20/images/sort_desc_disabled.png +0 -0
- data/coverage/assets/0.13.2/application.css +1 -0
- data/coverage/assets/0.13.2/application.js +7 -0
- data/coverage/assets/0.13.2/colorbox/border.png +0 -0
- data/coverage/assets/0.13.2/colorbox/controls.png +0 -0
- data/coverage/assets/0.13.2/colorbox/loading.gif +0 -0
- data/coverage/assets/0.13.2/colorbox/loading_background.png +0 -0
- data/coverage/assets/0.13.2/favicon_green.png +0 -0
- data/coverage/assets/0.13.2/favicon_red.png +0 -0
- data/coverage/assets/0.13.2/favicon_yellow.png +0 -0
- data/coverage/assets/0.13.2/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/coverage/assets/0.13.2/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/coverage/assets/0.13.2/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/coverage/assets/0.13.2/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/coverage/assets/0.13.2/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/coverage/assets/0.13.2/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/coverage/assets/0.13.2/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/coverage/assets/0.13.2/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/coverage/assets/0.13.2/images/ui-icons_222222_256x240.png +0 -0
- data/coverage/assets/0.13.2/images/ui-icons_2e83ff_256x240.png +0 -0
- data/coverage/assets/0.13.2/images/ui-icons_454545_256x240.png +0 -0
- data/coverage/assets/0.13.2/images/ui-icons_888888_256x240.png +0 -0
- data/coverage/assets/0.13.2/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/coverage/assets/0.13.2/loading.gif +0 -0
- data/coverage/assets/0.13.2/magnify.png +0 -0
- data/coverage/coverage.json +1368 -0
- data/coverage/index.html +15044 -0
- data/lib/.DS_Store +0 -0
- data/lib/senec/cloud/connection.rb +96 -39
- data/lib/senec/cloud/error.rb +0 -6
- data/lib/senec/cloud/stats_overview.rb +52 -0
- data/lib/senec/cloud/wallboxes.rb +52 -0
- data/lib/senec/local/request.rb +1 -1
- data/lib/senec/local/state.rb +1 -0
- data/lib/senec/version.rb +1 -1
- data/lib/senec.rb +2 -2
- data/pkg/senec-0.1.0.gem +0 -0
- data/pkg/senec-0.10.0.gem +0 -0
- data/pkg/senec-0.11.0.gem +0 -0
- data/pkg/senec-0.12.0.gem +0 -0
- data/pkg/senec-0.13.0.gem +0 -0
- data/pkg/senec-0.14.0.gem +0 -0
- data/pkg/senec-0.15.0.gem +0 -0
- data/pkg/senec-0.17.0.gem +0 -0
- data/pkg/senec-0.17.1.gem +0 -0
- data/pkg/senec-0.17.2.gem +0 -0
- data/pkg/senec-0.18.0.gem +0 -0
- data/pkg/senec-0.2.0.gem +0 -0
- data/pkg/senec-0.3.0.gem +0 -0
- data/pkg/senec-0.4.0.gem +0 -0
- data/pkg/senec-0.5.0.gem +0 -0
- data/pkg/senec-0.6.0.gem +0 -0
- data/pkg/senec-0.6.1.gem +0 -0
- data/pkg/senec-0.6.2.gem +0 -0
- data/pkg/senec-0.7.0.gem +0 -0
- data/pkg/senec-0.7.1.gem +0 -0
- data/pkg/senec-0.7.2.gem +0 -0
- data/pkg/senec-0.8.0.gem +0 -0
- data/pkg/senec-0.9.0.gem +0 -0
- metadata +71 -13
- data/.github/workflows/push.yml +0 -37
- data/Gemfile +0 -43
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/lib/senec/cloud/dashboard.rb +0 -69
- data/lib/senec/cloud/technical_data.rb +0 -69
- data/senec.gemspec +0 -32
@@ -1,69 +0,0 @@
|
|
1
|
-
require_relative 'connection'
|
2
|
-
|
3
|
-
# Model for the Senec dashboard data.
|
4
|
-
#
|
5
|
-
# Example use:
|
6
|
-
#
|
7
|
-
# connection = Senec::Cloud::Connection.new(username: '...', password: '...')
|
8
|
-
#
|
9
|
-
# # Get the data of a specific system:
|
10
|
-
# Dashboard[connection].find('123456')
|
11
|
-
#
|
12
|
-
# # Get the data of the default system:
|
13
|
-
# Dashboard[connection].first
|
14
|
-
#
|
15
|
-
module Senec
|
16
|
-
module Cloud
|
17
|
-
class Dashboard
|
18
|
-
class Finder
|
19
|
-
def initialize(connection)
|
20
|
-
@connection = connection
|
21
|
-
end
|
22
|
-
attr_reader :connection
|
23
|
-
|
24
|
-
def find(system_id)
|
25
|
-
Dashboard.new(connection:, system_id:).tap(&:load_data)
|
26
|
-
end
|
27
|
-
|
28
|
-
def first
|
29
|
-
find(connection.default_system_id)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def self.[](connection)
|
34
|
-
Finder.new(connection)
|
35
|
-
end
|
36
|
-
|
37
|
-
def initialize(connection: nil, system_id: nil, data: nil)
|
38
|
-
raise ArgumentError unless connection.nil? ^ data.nil?
|
39
|
-
|
40
|
-
@connection = connection
|
41
|
-
@system_id = system_id
|
42
|
-
|
43
|
-
# Useful for testing only
|
44
|
-
@data = data
|
45
|
-
end
|
46
|
-
|
47
|
-
def load_data
|
48
|
-
raise 'Data already present!' if @data
|
49
|
-
|
50
|
-
@system_id ||= connection.default_system_id
|
51
|
-
@data = fetch_data
|
52
|
-
end
|
53
|
-
|
54
|
-
attr_reader :system_id, :data
|
55
|
-
|
56
|
-
private
|
57
|
-
|
58
|
-
def get(path, params: nil)
|
59
|
-
@connection.get(path, params:)
|
60
|
-
end
|
61
|
-
|
62
|
-
def fetch_data
|
63
|
-
return unless system_id
|
64
|
-
|
65
|
-
get("/v1/senec/systems/#{system_id}/dashboard")
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
@@ -1,69 +0,0 @@
|
|
1
|
-
require_relative 'connection'
|
2
|
-
|
3
|
-
# Model for the Senec technical data.
|
4
|
-
#
|
5
|
-
# Example use:
|
6
|
-
#
|
7
|
-
# connection = Senec::Cloud::Connection.new(username: '...', password: '...')
|
8
|
-
#
|
9
|
-
# # Get the data of a specific system:
|
10
|
-
# TechnicalData[connection].find('123456')
|
11
|
-
#
|
12
|
-
# # Get the data of the default system:
|
13
|
-
# TechnicalData[connection].first
|
14
|
-
#
|
15
|
-
module Senec
|
16
|
-
module Cloud
|
17
|
-
class TechnicalData
|
18
|
-
class Finder
|
19
|
-
def initialize(connection)
|
20
|
-
@connection = connection
|
21
|
-
end
|
22
|
-
attr_reader :connection
|
23
|
-
|
24
|
-
def find(system_id)
|
25
|
-
TechnicalData.new(connection:, system_id:).tap(&:load_data)
|
26
|
-
end
|
27
|
-
|
28
|
-
def first
|
29
|
-
find(connection.default_system_id)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def self.[](connection)
|
34
|
-
Finder.new(connection)
|
35
|
-
end
|
36
|
-
|
37
|
-
def initialize(connection: nil, system_id: nil, data: nil)
|
38
|
-
raise ArgumentError unless connection.nil? ^ data.nil?
|
39
|
-
|
40
|
-
@connection = connection
|
41
|
-
@system_id = system_id
|
42
|
-
|
43
|
-
# Useful for testing only
|
44
|
-
@data = data
|
45
|
-
end
|
46
|
-
|
47
|
-
def load_data
|
48
|
-
raise 'Data already present!' if @data
|
49
|
-
|
50
|
-
@system_id ||= connection.default_system_id
|
51
|
-
@data = fetch_data
|
52
|
-
end
|
53
|
-
|
54
|
-
attr_reader :system_id, :data
|
55
|
-
|
56
|
-
private
|
57
|
-
|
58
|
-
def get(path, params: nil)
|
59
|
-
@connection.get(path, params:)
|
60
|
-
end
|
61
|
-
|
62
|
-
def fetch_data
|
63
|
-
return unless system_id
|
64
|
-
|
65
|
-
get("/v1/senec/systems/#{system_id}/technical-data")
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
data/senec.gemspec
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
require_relative 'lib/senec/version'
|
2
|
-
|
3
|
-
Gem::Specification.new do |spec|
|
4
|
-
spec.name = 'senec'
|
5
|
-
spec.version = Senec::VERSION
|
6
|
-
spec.authors = ['Georg Ledermann']
|
7
|
-
spec.email = ['georg@ledermann.dev']
|
8
|
-
|
9
|
-
spec.summary = 'Unofficial Ruby Client for SENEC Home'
|
10
|
-
spec.description = 'Access your local SENEC Solar Battery Storage System'
|
11
|
-
spec.homepage = 'https://github.com/solectrus/senec'
|
12
|
-
spec.license = 'MIT'
|
13
|
-
spec.required_ruby_version = Gem::Requirement.new('>= 3.2.0')
|
14
|
-
spec.add_dependency 'faraday'
|
15
|
-
spec.add_dependency 'faraday-net_http_persistent'
|
16
|
-
spec.add_dependency 'faraday-request-timer'
|
17
|
-
|
18
|
-
spec.metadata['homepage_uri'] = spec.homepage
|
19
|
-
spec.metadata['source_code_uri'] = 'https://github.com/solectrus/senec'
|
20
|
-
spec.metadata['changelog_uri'] = 'https://github.com/solectrus/senec/releases'
|
21
|
-
spec.metadata['rubygems_mfa_required'] = 'true'
|
22
|
-
|
23
|
-
# Specify which files should be added to the gem when it is released.
|
24
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
25
|
-
spec.files =
|
26
|
-
Dir.chdir(File.expand_path(__dir__)) do
|
27
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
28
|
-
end
|
29
|
-
spec.bindir = 'exe'
|
30
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
|
-
spec.require_paths = ['lib']
|
32
|
-
end
|