senec 0.15.0 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/push.yml +1 -1
- data/.vscode/settings.json +0 -7
- data/CODE_OF_CONDUCT.md +109 -51
- data/Gemfile +5 -5
- data/{LICENSE.txt → LICENSE} +6 -6
- data/lib/senec/local/constants.rb +2 -1
- data/lib/senec/local/state.rb +19 -7
- data/lib/senec/version.rb +1 -1
- data/senec.gemspec +3 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c346c95eeb0e8ad33546fed3c8bbf66ea31910f9fcc1f20a16678b901b720c7f
|
4
|
+
data.tar.gz: 948a6b2aa16c66366a46727f57e1b172e78b4976f2009ebb7ab50c569f81fe32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21e66df0b03e26ed5f709ef170020876461b0164bd970202ed2b4a9d48eb1181609705764e20c48744f69a6c86aa1265e3140f86fe616c1b757b2fc5b08caf58
|
7
|
+
data.tar.gz: 5337388e3ad9a93e1bbf8737c302ff85c1eb050530ef441b3730f7efc67db7affb05de5af4fbfbb8976a1723335b081f69c19ce969979ec4a48e77789a900381
|
data/.github/workflows/push.yml
CHANGED
data/.vscode/settings.json
CHANGED
@@ -1,16 +1,9 @@
|
|
1
1
|
{
|
2
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
3
2
|
"editor.formatOnSave": true,
|
4
3
|
"editor.tabSize": 2,
|
5
4
|
|
6
5
|
"files.trimTrailingWhitespace": true,
|
7
6
|
|
8
|
-
"ruby.lint": {
|
9
|
-
"rubocop": {
|
10
|
-
"forceExclusion": true
|
11
|
-
}
|
12
|
-
},
|
13
|
-
|
14
7
|
"[ruby]": {
|
15
8
|
"editor.defaultFormatter": "Shopify.ruby-lsp",
|
16
9
|
"editor.formatOnSave": true
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -2,73 +2,131 @@
|
|
2
2
|
|
3
3
|
## Our Pledge
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
nationality, personal appearance, race, religion, or sexual
|
10
|
-
orientation.
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
9
|
+
nationality, personal appearance, race, caste, color, religion, or sexual
|
10
|
+
identity and orientation.
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
Examples of behavior that contributes to creating a positive environment
|
15
|
-
include:
|
16
|
-
|
17
|
-
* Using welcoming and inclusive language
|
18
|
-
* Being respectful of differing viewpoints and experiences
|
19
|
-
* Gracefully accepting constructive criticism
|
20
|
-
* Focusing on what is best for the community
|
21
|
-
* Showing empathy towards other community members
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
13
|
+
diverse, inclusive, and healthy community.
|
22
14
|
|
23
|
-
|
15
|
+
## Our Standards
|
24
16
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
18
|
+
community include:
|
19
|
+
|
20
|
+
- Demonstrating empathy and kindness toward other people
|
21
|
+
- Being respectful of differing opinions, viewpoints, and experiences
|
22
|
+
- Giving and gracefully accepting constructive feedback
|
23
|
+
- Accepting responsibility and apologizing to those affected by our mistakes,
|
24
|
+
and learning from the experience
|
25
|
+
- Focusing on what is best not just for us as individuals, but for the overall
|
26
|
+
community
|
27
|
+
|
28
|
+
Examples of unacceptable behavior include:
|
29
|
+
|
30
|
+
- The use of sexualized language or imagery, and sexual attention or advances of
|
31
|
+
any kind
|
32
|
+
- Trolling, insulting or derogatory comments, and personal or political attacks
|
33
|
+
- Public or private harassment
|
34
|
+
- Publishing others' private information, such as a physical or email address,
|
35
|
+
without their explicit permission
|
36
|
+
- Other conduct which could reasonably be considered inappropriate in a
|
32
37
|
professional setting
|
33
38
|
|
34
|
-
##
|
39
|
+
## Enforcement Responsibilities
|
35
40
|
|
36
|
-
|
37
|
-
behavior and
|
38
|
-
response to any
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
44
|
+
or harmful.
|
39
45
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
threatening, offensive, or harmful.
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
49
|
+
decisions when appropriate.
|
45
50
|
|
46
51
|
## Scope
|
47
52
|
|
48
|
-
This Code of Conduct applies
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
representative at an online or offline event.
|
53
|
-
further defined and clarified by project maintainers.
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
54
|
+
an individual is officially representing the community in public spaces.
|
55
|
+
Examples of representing our community include using an official email address,
|
56
|
+
posting via an official social media account, or acting as an appointed
|
57
|
+
representative at an online or offline event.
|
54
58
|
|
55
59
|
## Enforcement
|
56
60
|
|
57
61
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
-
reported
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
62
|
+
reported to the community leaders responsible for enforcement at
|
63
|
+
[INSERT CONTACT METHOD].
|
64
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
65
|
+
|
66
|
+
All community leaders are obligated to respect the privacy and security of the
|
67
|
+
reporter of any incident.
|
68
|
+
|
69
|
+
## Enforcement Guidelines
|
70
|
+
|
71
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
72
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
73
|
+
|
74
|
+
### 1. Correction
|
75
|
+
|
76
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
77
|
+
unprofessional or unwelcome in the community.
|
78
|
+
|
79
|
+
**Consequence**: A private, written warning from community leaders, providing
|
80
|
+
clarity around the nature of the violation and an explanation of why the
|
81
|
+
behavior was inappropriate. A public apology may be requested.
|
63
82
|
|
64
|
-
|
65
|
-
|
66
|
-
|
83
|
+
### 2. Warning
|
84
|
+
|
85
|
+
**Community Impact**: A violation through a single incident or series of
|
86
|
+
actions.
|
87
|
+
|
88
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
89
|
+
interaction with the people involved, including unsolicited interaction with
|
90
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
91
|
+
includes avoiding interactions in community spaces as well as external channels
|
92
|
+
like social media. Violating these terms may lead to a temporary or permanent
|
93
|
+
ban.
|
94
|
+
|
95
|
+
### 3. Temporary Ban
|
96
|
+
|
97
|
+
**Community Impact**: A serious violation of community standards, including
|
98
|
+
sustained inappropriate behavior.
|
99
|
+
|
100
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
101
|
+
communication with the community for a specified period of time. No public or
|
102
|
+
private interaction with the people involved, including unsolicited interaction
|
103
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
104
|
+
Violating these terms may lead to a permanent ban.
|
105
|
+
|
106
|
+
### 4. Permanent Ban
|
107
|
+
|
108
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
109
|
+
standards, including sustained inappropriate behavior, harassment of an
|
110
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
111
|
+
|
112
|
+
**Consequence**: A permanent ban from any sort of public interaction within the
|
113
|
+
community.
|
67
114
|
|
68
115
|
## Attribution
|
69
116
|
|
70
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
71
|
-
available at
|
117
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
118
|
+
version 2.1, available at
|
119
|
+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
120
|
+
|
121
|
+
Community Impact Guidelines were inspired by
|
122
|
+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
123
|
+
|
124
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
125
|
+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
126
|
+
[https://www.contributor-covenant.org/translations][translations].
|
72
127
|
|
73
|
-
[homepage]: https://contributor-covenant.org
|
74
|
-
[
|
128
|
+
[homepage]: https://www.contributor-covenant.org
|
129
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
130
|
+
[Mozilla CoC]: https://github.com/mozilla/diversity
|
131
|
+
[FAQ]: https://www.contributor-covenant.org/faq
|
132
|
+
[translations]: https://www.contributor-covenant.org/translations
|
data/Gemfile
CHANGED
@@ -12,20 +12,20 @@ gem 'bigdecimal'
|
|
12
12
|
# Rake is a Make-like program implemented in Ruby (https://github.com/ruby/rake)
|
13
13
|
gem 'rake'
|
14
14
|
|
15
|
-
# rspec-3.
|
15
|
+
# rspec-3.13.0 (http://github.com/rspec)
|
16
16
|
gem 'rspec'
|
17
17
|
|
18
18
|
# Automatic Ruby code style checking tool. (https://github.com/rubocop/rubocop)
|
19
|
-
gem 'rubocop'
|
19
|
+
gem 'rubocop', require: false
|
20
20
|
|
21
21
|
# Automatic performance checking tool for Ruby code. (https://github.com/rubocop/rubocop-performance)
|
22
|
-
gem 'rubocop-performance'
|
22
|
+
gem 'rubocop-performance', require: false
|
23
23
|
|
24
24
|
# Code style checking for RSpec files (https://github.com/rubocop/rubocop-rspec)
|
25
|
-
gem 'rubocop-rspec'
|
25
|
+
gem 'rubocop-rspec', require: false
|
26
26
|
|
27
27
|
# A RuboCop plugin for Rake (https://github.com/rubocop/rubocop-rake)
|
28
|
-
gem 'rubocop-rake'
|
28
|
+
gem 'rubocop-rake', require: false
|
29
29
|
|
30
30
|
# Thread-safety checks via static analysis (https://github.com/rubocop/rubocop-thread_safety)
|
31
31
|
gem 'rubocop-thread_safety', require: false
|
data/{LICENSE.txt → LICENSE}
RENAMED
@@ -1,6 +1,6 @@
|
|
1
|
-
|
1
|
+
MIT License
|
2
2
|
|
3
|
-
Copyright (c) 2020-2024 Georg Ledermann
|
3
|
+
Copyright (c) 2020-2024 Georg Ledermann <georg@ledermann.dev>
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
9
|
copies of the Software, and to permit persons to whom the Software is
|
10
10
|
furnished to do so, subject to the following conditions:
|
11
11
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
14
|
|
15
15
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
16
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
17
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/lib/senec/local/state.rb
CHANGED
@@ -15,18 +15,30 @@ module Senec
|
|
15
15
|
# ...
|
16
16
|
# };
|
17
17
|
def names(language: :de)
|
18
|
-
response(language:)
|
19
|
-
key, value = line.match(LINE_REGEX)&.captures
|
20
|
-
next unless key && value
|
18
|
+
js_content = response(language:)
|
21
19
|
|
22
|
-
|
23
|
-
|
20
|
+
# Extract the matched content
|
21
|
+
match = js_content.match(FILE_REGEX)
|
22
|
+
return unless match
|
23
|
+
|
24
|
+
# Extract the JSON-like part
|
25
|
+
json_like = "{#{match[1]}}"
|
26
|
+
|
27
|
+
# The keys are numbers, which is not valid JSON, so we need to convert them to strings
|
28
|
+
json = json_like.gsub(/(\d+)\s*:/, '"\1":')
|
29
|
+
|
30
|
+
# Convert the JSON string to a Ruby hash
|
31
|
+
hash = JSON.parse(json)
|
32
|
+
|
33
|
+
# Convert keys from strings to integers
|
34
|
+
hash.transform_keys(&:to_i)
|
24
35
|
end
|
25
36
|
|
26
37
|
private
|
27
38
|
|
28
|
-
|
29
|
-
|
39
|
+
# Regex pattern to match the system_state_name definition in the JavaScript file
|
40
|
+
# The file may be minimized, so we need to be flexible with whitespace and line breaks
|
41
|
+
FILE_REGEX = /system_state_name\s*=\s*{\s*([^}]*)\s*}/m
|
30
42
|
|
31
43
|
def response(language:)
|
32
44
|
res = connection.get url(language:)
|
data/lib/senec/version.rb
CHANGED
data/senec.gemspec
CHANGED
@@ -11,9 +11,9 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.homepage = 'https://github.com/solectrus/senec'
|
12
12
|
spec.license = 'MIT'
|
13
13
|
spec.required_ruby_version = Gem::Requirement.new('>= 3.2.0')
|
14
|
-
spec.
|
15
|
-
spec.
|
16
|
-
spec.
|
14
|
+
spec.add_dependency 'faraday'
|
15
|
+
spec.add_dependency 'faraday-net_http_persistent'
|
16
|
+
spec.add_dependency 'faraday-request-timer'
|
17
17
|
|
18
18
|
spec.metadata['homepage_uri'] = spec.homepage
|
19
19
|
spec.metadata['source_code_uri'] = 'https://github.com/solectrus/senec'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: senec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Georg Ledermann
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -67,7 +67,7 @@ files:
|
|
67
67
|
- ".vscode/settings.json"
|
68
68
|
- CODE_OF_CONDUCT.md
|
69
69
|
- Gemfile
|
70
|
-
- LICENSE
|
70
|
+
- LICENSE
|
71
71
|
- README.md
|
72
72
|
- Rakefile
|
73
73
|
- bin/console
|
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '0'
|
110
110
|
requirements: []
|
111
|
-
rubygems_version: 3.5.
|
111
|
+
rubygems_version: 3.5.17
|
112
112
|
signing_key:
|
113
113
|
specification_version: 4
|
114
114
|
summary: Unofficial Ruby Client for SENEC Home
|