bitvis-protobuf 0.1.2__tar.gz
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.
- bitvis_protobuf-0.1.2/LICENSE +201 -0
- bitvis_protobuf-0.1.2/MANIFEST.in +14 -0
- bitvis_protobuf-0.1.2/PKG-INFO +79 -0
- bitvis_protobuf-0.1.2/README.md +58 -0
- bitvis_protobuf-0.1.2/pyproject.toml +40 -0
- bitvis_protobuf-0.1.2/setup.cfg +4 -0
- bitvis_protobuf-0.1.2/src/bitvis_protobuf/__init__.py +15 -0
- bitvis_protobuf-0.1.2/src/bitvis_protobuf/device_info_pb2.py +37 -0
- bitvis_protobuf-0.1.2/src/bitvis_protobuf/device_info_pb2.pyi +17 -0
- bitvis_protobuf-0.1.2/src/bitvis_protobuf/diagnostic_pb2.py +52 -0
- bitvis_protobuf-0.1.2/src/bitvis_protobuf/diagnostic_pb2.pyi +73 -0
- bitvis_protobuf-0.1.2/src/bitvis_protobuf/han_port_pb2.py +36 -0
- bitvis_protobuf-0.1.2/src/bitvis_protobuf/han_port_pb2.pyi +65 -0
- bitvis_protobuf-0.1.2/src/bitvis_protobuf/powerhub_pb2.py +42 -0
- bitvis_protobuf-0.1.2/src/bitvis_protobuf/powerhub_pb2.pyi +54 -0
- bitvis_protobuf-0.1.2/src/bitvis_protobuf/proto/device_info.proto +13 -0
- bitvis_protobuf-0.1.2/src/bitvis_protobuf/proto/diagnostic.proto +46 -0
- bitvis_protobuf-0.1.2/src/bitvis_protobuf/proto/han_port.proto +42 -0
- bitvis_protobuf-0.1.2/src/bitvis_protobuf/proto/powerhub.proto +34 -0
- bitvis_protobuf-0.1.2/src/bitvis_protobuf/py.typed +1 -0
- bitvis_protobuf-0.1.2/src/bitvis_protobuf.egg-info/PKG-INFO +79 -0
- bitvis_protobuf-0.1.2/src/bitvis_protobuf.egg-info/SOURCES.txt +23 -0
- bitvis_protobuf-0.1.2/src/bitvis_protobuf.egg-info/dependency_links.txt +1 -0
- bitvis_protobuf-0.1.2/src/bitvis_protobuf.egg-info/requires.txt +1 -0
- bitvis_protobuf-0.1.2/src/bitvis_protobuf.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# MANIFEST.in - Include additional files in the package
|
|
2
|
+
|
|
3
|
+
include README.md
|
|
4
|
+
include LICENSE
|
|
5
|
+
include pyproject.toml
|
|
6
|
+
|
|
7
|
+
# Include protobuf source files
|
|
8
|
+
recursive-include src/bitvis_protobuf/proto *.proto
|
|
9
|
+
|
|
10
|
+
# Include type stubs
|
|
11
|
+
recursive-include src/bitvis_protobuf *.pyi
|
|
12
|
+
|
|
13
|
+
# Include py.typed marker
|
|
14
|
+
include src/bitvis_protobuf/py.typed
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bitvis-protobuf
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Protobuf definitions for Bitvis Power Hub
|
|
5
|
+
Author-email: Mandus Borjesson <mandus@example.com>
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/MandusBorjesson/bitvis-protobuf
|
|
8
|
+
Project-URL: Repository, https://github.com/MandusBorjesson/bitvis-protobuf
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Requires-Python: >=3.11
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Requires-Dist: protobuf>=4.25.0
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
|
|
22
|
+
# Bitvis Protobuf
|
|
23
|
+
|
|
24
|
+
Python protobuf definitions for Bitvis Power Hub communication.
|
|
25
|
+
|
|
26
|
+
## Description
|
|
27
|
+
|
|
28
|
+
This library contains the Protocol Buffer definitions and generated Python code for communicating with Bitvis Power Hub devices. It includes message definitions for:
|
|
29
|
+
|
|
30
|
+
- Device information
|
|
31
|
+
- Diagnostic data
|
|
32
|
+
- HAN port samples
|
|
33
|
+
- Power hub payloads
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install bitvis-protobuf
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Usage
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
from bitvis_protobuf import powerhub_pb2, han_port_pb2, diagnostic_pb2
|
|
45
|
+
|
|
46
|
+
# Parse a payload
|
|
47
|
+
payload = powerhub_pb2.Payload()
|
|
48
|
+
payload.ParseFromString(data)
|
|
49
|
+
|
|
50
|
+
if payload.HasField("sample"):
|
|
51
|
+
sample = payload.sample
|
|
52
|
+
# Process HAN port sample data
|
|
53
|
+
|
|
54
|
+
elif payload.HasField("diagnostic"):
|
|
55
|
+
diagnostic = payload.diagnostic
|
|
56
|
+
# Process diagnostic data
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Development
|
|
60
|
+
|
|
61
|
+
### Building from source
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Install development dependencies
|
|
65
|
+
pip install -e ".[dev]"
|
|
66
|
+
|
|
67
|
+
# Generate protobuf code
|
|
68
|
+
python -m build_proto
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Regenerating protobuf code
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
python scripts/generate_proto.py
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
Apache License 2.0
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Bitvis Protobuf
|
|
2
|
+
|
|
3
|
+
Python protobuf definitions for Bitvis Power Hub communication.
|
|
4
|
+
|
|
5
|
+
## Description
|
|
6
|
+
|
|
7
|
+
This library contains the Protocol Buffer definitions and generated Python code for communicating with Bitvis Power Hub devices. It includes message definitions for:
|
|
8
|
+
|
|
9
|
+
- Device information
|
|
10
|
+
- Diagnostic data
|
|
11
|
+
- HAN port samples
|
|
12
|
+
- Power hub payloads
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install bitvis-protobuf
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```python
|
|
23
|
+
from bitvis_protobuf import powerhub_pb2, han_port_pb2, diagnostic_pb2
|
|
24
|
+
|
|
25
|
+
# Parse a payload
|
|
26
|
+
payload = powerhub_pb2.Payload()
|
|
27
|
+
payload.ParseFromString(data)
|
|
28
|
+
|
|
29
|
+
if payload.HasField("sample"):
|
|
30
|
+
sample = payload.sample
|
|
31
|
+
# Process HAN port sample data
|
|
32
|
+
|
|
33
|
+
elif payload.HasField("diagnostic"):
|
|
34
|
+
diagnostic = payload.diagnostic
|
|
35
|
+
# Process diagnostic data
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Development
|
|
39
|
+
|
|
40
|
+
### Building from source
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Install development dependencies
|
|
44
|
+
pip install -e ".[dev]"
|
|
45
|
+
|
|
46
|
+
# Generate protobuf code
|
|
47
|
+
python -m build_proto
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Regenerating protobuf code
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
python scripts/generate_proto.py
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## License
|
|
57
|
+
|
|
58
|
+
Apache License 2.0
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68.0", "wheel", "grpcio-tools>=1.64.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "bitvis-protobuf"
|
|
7
|
+
version = "0.1.2"
|
|
8
|
+
description = "Protobuf definitions for Bitvis Power Hub"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = {text = "Apache-2.0"}
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Mandus Borjesson", email = "mandus@example.com"},
|
|
14
|
+
]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 3 - Alpha",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"License :: OSI Approved :: Apache Software License",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3.11",
|
|
21
|
+
"Programming Language :: Python :: 3.12",
|
|
22
|
+
"Programming Language :: Python :: 3.13",
|
|
23
|
+
]
|
|
24
|
+
dependencies = [
|
|
25
|
+
"protobuf>=4.25.0",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[project.urls]
|
|
29
|
+
Homepage = "https://github.com/MandusBorjesson/bitvis-protobuf"
|
|
30
|
+
Repository = "https://github.com/MandusBorjesson/bitvis-protobuf"
|
|
31
|
+
|
|
32
|
+
[tool.setuptools]
|
|
33
|
+
package-dir = {"" = "src"}
|
|
34
|
+
|
|
35
|
+
[tool.setuptools.packages.find]
|
|
36
|
+
where = ["src"]
|
|
37
|
+
include = ["bitvis_protobuf*"]
|
|
38
|
+
|
|
39
|
+
[tool.setuptools.package-data]
|
|
40
|
+
bitvis_protobuf = ["py.typed", "proto/*.proto"]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""Bitvis Power Hub protobuf definitions."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
__version__ = "0.1.0"
|
|
6
|
+
|
|
7
|
+
# Re-export generated protobuf modules for convenience
|
|
8
|
+
from . import device_info_pb2, diagnostic_pb2, han_port_pb2, powerhub_pb2
|
|
9
|
+
|
|
10
|
+
__all__ = [
|
|
11
|
+
"device_info_pb2",
|
|
12
|
+
"diagnostic_pb2",
|
|
13
|
+
"han_port_pb2",
|
|
14
|
+
"powerhub_pb2",
|
|
15
|
+
]
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: device_info.proto
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
31,
|
|
16
|
+
1,
|
|
17
|
+
'',
|
|
18
|
+
'device_info.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11\x64\x65vice_info.proto\x12\x0b\x64\x65vice_info\"^\n\nDeviceInfo\x12\x13\n\x0bmac_address\x18\x01 \x01(\x0c\x12\x12\n\nmodel_name\x18\x02 \x01(\t\x12\x12\n\nsw_version\x18\x03 \x01(\t\x12\x13\n\x0bhw_revision\x18\x04 \x01(\rB;\n7io.bitvis.power.interfaces.powerhub.deviceinfo.protobufP\x01\x62\x06proto3')
|
|
28
|
+
|
|
29
|
+
_globals = globals()
|
|
30
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
31
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'device_info_pb2', _globals)
|
|
32
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
33
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
34
|
+
_globals['DESCRIPTOR']._serialized_options = b'\n7io.bitvis.power.interfaces.powerhub.deviceinfo.protobufP\001'
|
|
35
|
+
_globals['_DEVICEINFO']._serialized_start=34
|
|
36
|
+
_globals['_DEVICEINFO']._serialized_end=128
|
|
37
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from google.protobuf import descriptor as _descriptor
|
|
2
|
+
from google.protobuf import message as _message
|
|
3
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional
|
|
4
|
+
|
|
5
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
6
|
+
|
|
7
|
+
class DeviceInfo(_message.Message):
|
|
8
|
+
__slots__ = ("mac_address", "model_name", "sw_version", "hw_revision")
|
|
9
|
+
MAC_ADDRESS_FIELD_NUMBER: _ClassVar[int]
|
|
10
|
+
MODEL_NAME_FIELD_NUMBER: _ClassVar[int]
|
|
11
|
+
SW_VERSION_FIELD_NUMBER: _ClassVar[int]
|
|
12
|
+
HW_REVISION_FIELD_NUMBER: _ClassVar[int]
|
|
13
|
+
mac_address: bytes
|
|
14
|
+
model_name: str
|
|
15
|
+
sw_version: str
|
|
16
|
+
hw_revision: int
|
|
17
|
+
def __init__(self, mac_address: _Optional[bytes] = ..., model_name: _Optional[str] = ..., sw_version: _Optional[str] = ..., hw_revision: _Optional[int] = ...) -> None: ...
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: diagnostic.proto
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
31,
|
|
16
|
+
1,
|
|
17
|
+
'',
|
|
18
|
+
'diagnostic.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
from . import device_info_pb2 as device__info__pb2
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10\x64iagnostic.proto\x12\ndiagnostic\x1a\x11\x64\x65vice_info.proto\"\x93\x04\n\x08\x43ounters\x12\'\n\x1fhawkbit_status_connection_error\x18\x01 \x01(\r\x12,\n hawkbit_status_unconfirmed_image\x18\x02 \x01(\rB\x02\x18\x01\x12)\n\x1dhawkbit_status_metadata_error\x18\x03 \x01(\rB\x02\x18\x01\x12%\n\x1dhawkbit_status_download_error\x18\x04 \x01(\r\x12*\n\x1ehawkbit_status_already_updated\x18\x05 \x01(\rB\x02\x18\x01\x12(\n hawkbit_status_update_downloaded\x18\x06 \x01(\r\x12 \n\x18hawkbit_status_no_update\x18\x07 \x01(\r\x12(\n\x1chawkbit_status_cancel_update\x18\x08 \x01(\rB\x02\x18\x01\x12,\n hawkbit_status_probe_in_progress\x18\t \x01(\rB\x02\x18\x01\x12$\n\x1ctimeout_internet_unreachable\x18\n \x01(\r\x12\"\n\x1atimeout_hawkbit_connection\x18\x0b \x01(\r\x12#\n\x1bhan_msg_successfully_parsed\x18\x0c \x01(\r\x12\x1f\n\x17han_msg_buffer_overflow\x18\r \x01(\r\"\xb0\x01\n\nDiagnostic\x12#\n\x04type\x18\x01 \x01(\x0e\x32\x15.diagnostic.EventType\x12\x10\n\x08uptime_s\x18\x02 \x01(\x04\x12\x15\n\rwifi_rssi_dbm\x18\x03 \x01(\x05\x12,\n\x0b\x64\x65vice_info\x18\x04 \x01(\x0b\x32\x17.device_info.DeviceInfo\x12&\n\x08\x63ounters\x18\x05 \x01(\x0b\x32\x14.diagnostic.Counters*\x9b\x02\n\tEventType\x12\x1a\n\x16\x45VENT_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10\x45VENT_TYPE_TIMER\x10\x01\x12%\n!EVENT_TYPE_PROVISIONING_REQUESTED\x10\x02\x12\x1d\n\x19\x45VENT_TYPE_MQTT_CONNECTED\x10\x03\x12\x1f\n\x1b\x45VENT_TYPE_REBOOT_REQUESTED\x10\x04\x12\x1b\n\x17\x45VENT_TYPE_BOOT_UNKNOWN\x10\x05\x12\x1c\n\x18\x45VENT_TYPE_BOOT_SOFTWARE\x10\x06\x12\x1c\n\x18\x45VENT_TYPE_BOOT_POWER_ON\x10\x07\x12\x1c\n\x18\x45VENT_TYPE_BOOT_WATCHDOG\x10\x08\x42;\n7io.bitvis.power.interfaces.powerhub.diagnostic.protobufP\x01\x62\x06proto3')
|
|
29
|
+
|
|
30
|
+
_globals = globals()
|
|
31
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
32
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'diagnostic_pb2', _globals)
|
|
33
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
34
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
35
|
+
_globals['DESCRIPTOR']._serialized_options = b'\n7io.bitvis.power.interfaces.powerhub.diagnostic.protobufP\001'
|
|
36
|
+
_globals['_COUNTERS'].fields_by_name['hawkbit_status_unconfirmed_image']._loaded_options = None
|
|
37
|
+
_globals['_COUNTERS'].fields_by_name['hawkbit_status_unconfirmed_image']._serialized_options = b'\030\001'
|
|
38
|
+
_globals['_COUNTERS'].fields_by_name['hawkbit_status_metadata_error']._loaded_options = None
|
|
39
|
+
_globals['_COUNTERS'].fields_by_name['hawkbit_status_metadata_error']._serialized_options = b'\030\001'
|
|
40
|
+
_globals['_COUNTERS'].fields_by_name['hawkbit_status_already_updated']._loaded_options = None
|
|
41
|
+
_globals['_COUNTERS'].fields_by_name['hawkbit_status_already_updated']._serialized_options = b'\030\001'
|
|
42
|
+
_globals['_COUNTERS'].fields_by_name['hawkbit_status_cancel_update']._loaded_options = None
|
|
43
|
+
_globals['_COUNTERS'].fields_by_name['hawkbit_status_cancel_update']._serialized_options = b'\030\001'
|
|
44
|
+
_globals['_COUNTERS'].fields_by_name['hawkbit_status_probe_in_progress']._loaded_options = None
|
|
45
|
+
_globals['_COUNTERS'].fields_by_name['hawkbit_status_probe_in_progress']._serialized_options = b'\030\001'
|
|
46
|
+
_globals['_EVENTTYPE']._serialized_start=765
|
|
47
|
+
_globals['_EVENTTYPE']._serialized_end=1048
|
|
48
|
+
_globals['_COUNTERS']._serialized_start=52
|
|
49
|
+
_globals['_COUNTERS']._serialized_end=583
|
|
50
|
+
_globals['_DIAGNOSTIC']._serialized_start=586
|
|
51
|
+
_globals['_DIAGNOSTIC']._serialized_end=762
|
|
52
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import device_info_pb2 as _device_info_pb2
|
|
2
|
+
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
|
|
3
|
+
from google.protobuf import descriptor as _descriptor
|
|
4
|
+
from google.protobuf import message as _message
|
|
5
|
+
from collections.abc import Mapping as _Mapping
|
|
6
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
|
|
7
|
+
|
|
8
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
9
|
+
|
|
10
|
+
class EventType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
11
|
+
__slots__ = ()
|
|
12
|
+
EVENT_TYPE_UNSPECIFIED: _ClassVar[EventType]
|
|
13
|
+
EVENT_TYPE_TIMER: _ClassVar[EventType]
|
|
14
|
+
EVENT_TYPE_PROVISIONING_REQUESTED: _ClassVar[EventType]
|
|
15
|
+
EVENT_TYPE_MQTT_CONNECTED: _ClassVar[EventType]
|
|
16
|
+
EVENT_TYPE_REBOOT_REQUESTED: _ClassVar[EventType]
|
|
17
|
+
EVENT_TYPE_BOOT_UNKNOWN: _ClassVar[EventType]
|
|
18
|
+
EVENT_TYPE_BOOT_SOFTWARE: _ClassVar[EventType]
|
|
19
|
+
EVENT_TYPE_BOOT_POWER_ON: _ClassVar[EventType]
|
|
20
|
+
EVENT_TYPE_BOOT_WATCHDOG: _ClassVar[EventType]
|
|
21
|
+
EVENT_TYPE_UNSPECIFIED: EventType
|
|
22
|
+
EVENT_TYPE_TIMER: EventType
|
|
23
|
+
EVENT_TYPE_PROVISIONING_REQUESTED: EventType
|
|
24
|
+
EVENT_TYPE_MQTT_CONNECTED: EventType
|
|
25
|
+
EVENT_TYPE_REBOOT_REQUESTED: EventType
|
|
26
|
+
EVENT_TYPE_BOOT_UNKNOWN: EventType
|
|
27
|
+
EVENT_TYPE_BOOT_SOFTWARE: EventType
|
|
28
|
+
EVENT_TYPE_BOOT_POWER_ON: EventType
|
|
29
|
+
EVENT_TYPE_BOOT_WATCHDOG: EventType
|
|
30
|
+
|
|
31
|
+
class Counters(_message.Message):
|
|
32
|
+
__slots__ = ("hawkbit_status_connection_error", "hawkbit_status_unconfirmed_image", "hawkbit_status_metadata_error", "hawkbit_status_download_error", "hawkbit_status_already_updated", "hawkbit_status_update_downloaded", "hawkbit_status_no_update", "hawkbit_status_cancel_update", "hawkbit_status_probe_in_progress", "timeout_internet_unreachable", "timeout_hawkbit_connection", "han_msg_successfully_parsed", "han_msg_buffer_overflow")
|
|
33
|
+
HAWKBIT_STATUS_CONNECTION_ERROR_FIELD_NUMBER: _ClassVar[int]
|
|
34
|
+
HAWKBIT_STATUS_UNCONFIRMED_IMAGE_FIELD_NUMBER: _ClassVar[int]
|
|
35
|
+
HAWKBIT_STATUS_METADATA_ERROR_FIELD_NUMBER: _ClassVar[int]
|
|
36
|
+
HAWKBIT_STATUS_DOWNLOAD_ERROR_FIELD_NUMBER: _ClassVar[int]
|
|
37
|
+
HAWKBIT_STATUS_ALREADY_UPDATED_FIELD_NUMBER: _ClassVar[int]
|
|
38
|
+
HAWKBIT_STATUS_UPDATE_DOWNLOADED_FIELD_NUMBER: _ClassVar[int]
|
|
39
|
+
HAWKBIT_STATUS_NO_UPDATE_FIELD_NUMBER: _ClassVar[int]
|
|
40
|
+
HAWKBIT_STATUS_CANCEL_UPDATE_FIELD_NUMBER: _ClassVar[int]
|
|
41
|
+
HAWKBIT_STATUS_PROBE_IN_PROGRESS_FIELD_NUMBER: _ClassVar[int]
|
|
42
|
+
TIMEOUT_INTERNET_UNREACHABLE_FIELD_NUMBER: _ClassVar[int]
|
|
43
|
+
TIMEOUT_HAWKBIT_CONNECTION_FIELD_NUMBER: _ClassVar[int]
|
|
44
|
+
HAN_MSG_SUCCESSFULLY_PARSED_FIELD_NUMBER: _ClassVar[int]
|
|
45
|
+
HAN_MSG_BUFFER_OVERFLOW_FIELD_NUMBER: _ClassVar[int]
|
|
46
|
+
hawkbit_status_connection_error: int
|
|
47
|
+
hawkbit_status_unconfirmed_image: int
|
|
48
|
+
hawkbit_status_metadata_error: int
|
|
49
|
+
hawkbit_status_download_error: int
|
|
50
|
+
hawkbit_status_already_updated: int
|
|
51
|
+
hawkbit_status_update_downloaded: int
|
|
52
|
+
hawkbit_status_no_update: int
|
|
53
|
+
hawkbit_status_cancel_update: int
|
|
54
|
+
hawkbit_status_probe_in_progress: int
|
|
55
|
+
timeout_internet_unreachable: int
|
|
56
|
+
timeout_hawkbit_connection: int
|
|
57
|
+
han_msg_successfully_parsed: int
|
|
58
|
+
han_msg_buffer_overflow: int
|
|
59
|
+
def __init__(self, hawkbit_status_connection_error: _Optional[int] = ..., hawkbit_status_unconfirmed_image: _Optional[int] = ..., hawkbit_status_metadata_error: _Optional[int] = ..., hawkbit_status_download_error: _Optional[int] = ..., hawkbit_status_already_updated: _Optional[int] = ..., hawkbit_status_update_downloaded: _Optional[int] = ..., hawkbit_status_no_update: _Optional[int] = ..., hawkbit_status_cancel_update: _Optional[int] = ..., hawkbit_status_probe_in_progress: _Optional[int] = ..., timeout_internet_unreachable: _Optional[int] = ..., timeout_hawkbit_connection: _Optional[int] = ..., han_msg_successfully_parsed: _Optional[int] = ..., han_msg_buffer_overflow: _Optional[int] = ...) -> None: ...
|
|
60
|
+
|
|
61
|
+
class Diagnostic(_message.Message):
|
|
62
|
+
__slots__ = ("type", "uptime_s", "wifi_rssi_dbm", "device_info", "counters")
|
|
63
|
+
TYPE_FIELD_NUMBER: _ClassVar[int]
|
|
64
|
+
UPTIME_S_FIELD_NUMBER: _ClassVar[int]
|
|
65
|
+
WIFI_RSSI_DBM_FIELD_NUMBER: _ClassVar[int]
|
|
66
|
+
DEVICE_INFO_FIELD_NUMBER: _ClassVar[int]
|
|
67
|
+
COUNTERS_FIELD_NUMBER: _ClassVar[int]
|
|
68
|
+
type: EventType
|
|
69
|
+
uptime_s: int
|
|
70
|
+
wifi_rssi_dbm: int
|
|
71
|
+
device_info: _device_info_pb2.DeviceInfo
|
|
72
|
+
counters: Counters
|
|
73
|
+
def __init__(self, type: _Optional[_Union[EventType, str]] = ..., uptime_s: _Optional[int] = ..., wifi_rssi_dbm: _Optional[int] = ..., device_info: _Optional[_Union[_device_info_pb2.DeviceInfo, _Mapping]] = ..., counters: _Optional[_Union[Counters, _Mapping]] = ...) -> None: ...
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: han_port.proto
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
31,
|
|
16
|
+
1,
|
|
17
|
+
'',
|
|
18
|
+
'han_port.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0ehan_port.proto\x12\x08han_port\"\x87\x13\n\rHanPortSample\x12\"\n\x15timestamp_utc_meter_s\x18\x01 \x01(\x04H\x00\x88\x01\x01\x12 \n\x13timestamp_utc_ntp_s\x18\x1c \x01(\x04H\x01\x88\x01\x01\x12\x32\n%energy_active_delivered_to_client_kwh\x18\x02 \x01(\x02H\x02\x88\x01\x01\x12\x32\n%energy_active_delivered_by_client_kwh\x18\x03 \x01(\x02H\x03\x88\x01\x01\x12\x36\n)energy_reactive_delivered_to_client_kvarh\x18\x04 \x01(\x02H\x04\x88\x01\x01\x12\x36\n)energy_reactive_delivered_by_client_kvarh\x18\x05 \x01(\x02H\x05\x88\x01\x01\x12\x30\n#power_active_delivered_to_client_kw\x18\x06 \x01(\x02H\x06\x88\x01\x01\x12\x30\n#power_active_delivered_by_client_kw\x18\x07 \x01(\x02H\x07\x88\x01\x01\x12\x34\n\'power_reactive_delivered_to_client_kvar\x18\x08 \x01(\x02H\x08\x88\x01\x01\x12\x34\n\'power_reactive_delivered_by_client_kvar\x18\t \x01(\x02H\t\x88\x01\x01\x12\x33\n&power_active_l1_delivered_to_client_kw\x18\n \x01(\x02H\n\x88\x01\x01\x12\x33\n&power_active_l1_delivered_by_client_kw\x18\x0b \x01(\x02H\x0b\x88\x01\x01\x12\x33\n&power_active_l2_delivered_to_client_kw\x18\x0c \x01(\x02H\x0c\x88\x01\x01\x12\x33\n&power_active_l2_delivered_by_client_kw\x18\r \x01(\x02H\r\x88\x01\x01\x12\x33\n&power_active_l3_delivered_to_client_kw\x18\x0e \x01(\x02H\x0e\x88\x01\x01\x12\x33\n&power_active_l3_delivered_by_client_kw\x18\x0f \x01(\x02H\x0f\x88\x01\x01\x12\x37\n*power_reactive_l1_delivered_to_client_kvar\x18\x10 \x01(\x02H\x10\x88\x01\x01\x12\x37\n*power_reactive_l1_delivered_by_client_kvar\x18\x11 \x01(\x02H\x11\x88\x01\x01\x12\x37\n*power_reactive_l2_delivered_to_client_kvar\x18\x12 \x01(\x02H\x12\x88\x01\x01\x12\x37\n*power_reactive_l2_delivered_by_client_kvar\x18\x13 \x01(\x02H\x13\x88\x01\x01\x12\x37\n*power_reactive_l3_delivered_to_client_kvar\x18\x14 \x01(\x02H\x14\x88\x01\x01\x12\x37\n*power_reactive_l3_delivered_by_client_kvar\x18\x15 \x01(\x02H\x15\x88\x01\x01\x12\x1f\n\x12phase_voltage_l1_v\x18\x16 \x01(\x02H\x16\x88\x01\x01\x12\x1f\n\x12phase_voltage_l2_v\x18\x17 \x01(\x02H\x17\x88\x01\x01\x12\x1f\n\x12phase_voltage_l3_v\x18\x18 \x01(\x02H\x18\x88\x01\x01\x12\x1f\n\x12phase_current_l1_a\x18\x19 \x01(\x02H\x19\x88\x01\x01\x12\x1f\n\x12phase_current_l2_a\x18\x1a \x01(\x02H\x1a\x88\x01\x01\x12\x1f\n\x12phase_current_l3_a\x18\x1b \x01(\x02H\x1b\x88\x01\x01\x42\x18\n\x16_timestamp_utc_meter_sB\x16\n\x14_timestamp_utc_ntp_sB(\n&_energy_active_delivered_to_client_kwhB(\n&_energy_active_delivered_by_client_kwhB,\n*_energy_reactive_delivered_to_client_kvarhB,\n*_energy_reactive_delivered_by_client_kvarhB&\n$_power_active_delivered_to_client_kwB&\n$_power_active_delivered_by_client_kwB*\n(_power_reactive_delivered_to_client_kvarB*\n(_power_reactive_delivered_by_client_kvarB)\n\'_power_active_l1_delivered_to_client_kwB)\n\'_power_active_l1_delivered_by_client_kwB)\n\'_power_active_l2_delivered_to_client_kwB)\n\'_power_active_l2_delivered_by_client_kwB)\n\'_power_active_l3_delivered_to_client_kwB)\n\'_power_active_l3_delivered_by_client_kwB-\n+_power_reactive_l1_delivered_to_client_kvarB-\n+_power_reactive_l1_delivered_by_client_kvarB-\n+_power_reactive_l2_delivered_to_client_kvarB-\n+_power_reactive_l2_delivered_by_client_kvarB-\n+_power_reactive_l3_delivered_to_client_kvarB-\n+_power_reactive_l3_delivered_by_client_kvarB\x15\n\x13_phase_voltage_l1_vB\x15\n\x13_phase_voltage_l2_vB\x15\n\x13_phase_voltage_l3_vB\x15\n\x13_phase_current_l1_aB\x15\n\x13_phase_current_l2_aB\x15\n\x13_phase_current_l3_ab\x06proto3')
|
|
28
|
+
|
|
29
|
+
_globals = globals()
|
|
30
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
31
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'han_port_pb2', _globals)
|
|
32
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
33
|
+
DESCRIPTOR._loaded_options = None
|
|
34
|
+
_globals['_HANPORTSAMPLE']._serialized_start=29
|
|
35
|
+
_globals['_HANPORTSAMPLE']._serialized_end=2468
|
|
36
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
from google.protobuf import descriptor as _descriptor
|
|
2
|
+
from google.protobuf import message as _message
|
|
3
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional
|
|
4
|
+
|
|
5
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
6
|
+
|
|
7
|
+
class HanPortSample(_message.Message):
|
|
8
|
+
__slots__ = ("timestamp_utc_meter_s", "timestamp_utc_ntp_s", "energy_active_delivered_to_client_kwh", "energy_active_delivered_by_client_kwh", "energy_reactive_delivered_to_client_kvarh", "energy_reactive_delivered_by_client_kvarh", "power_active_delivered_to_client_kw", "power_active_delivered_by_client_kw", "power_reactive_delivered_to_client_kvar", "power_reactive_delivered_by_client_kvar", "power_active_l1_delivered_to_client_kw", "power_active_l1_delivered_by_client_kw", "power_active_l2_delivered_to_client_kw", "power_active_l2_delivered_by_client_kw", "power_active_l3_delivered_to_client_kw", "power_active_l3_delivered_by_client_kw", "power_reactive_l1_delivered_to_client_kvar", "power_reactive_l1_delivered_by_client_kvar", "power_reactive_l2_delivered_to_client_kvar", "power_reactive_l2_delivered_by_client_kvar", "power_reactive_l3_delivered_to_client_kvar", "power_reactive_l3_delivered_by_client_kvar", "phase_voltage_l1_v", "phase_voltage_l2_v", "phase_voltage_l3_v", "phase_current_l1_a", "phase_current_l2_a", "phase_current_l3_a")
|
|
9
|
+
TIMESTAMP_UTC_METER_S_FIELD_NUMBER: _ClassVar[int]
|
|
10
|
+
TIMESTAMP_UTC_NTP_S_FIELD_NUMBER: _ClassVar[int]
|
|
11
|
+
ENERGY_ACTIVE_DELIVERED_TO_CLIENT_KWH_FIELD_NUMBER: _ClassVar[int]
|
|
12
|
+
ENERGY_ACTIVE_DELIVERED_BY_CLIENT_KWH_FIELD_NUMBER: _ClassVar[int]
|
|
13
|
+
ENERGY_REACTIVE_DELIVERED_TO_CLIENT_KVARH_FIELD_NUMBER: _ClassVar[int]
|
|
14
|
+
ENERGY_REACTIVE_DELIVERED_BY_CLIENT_KVARH_FIELD_NUMBER: _ClassVar[int]
|
|
15
|
+
POWER_ACTIVE_DELIVERED_TO_CLIENT_KW_FIELD_NUMBER: _ClassVar[int]
|
|
16
|
+
POWER_ACTIVE_DELIVERED_BY_CLIENT_KW_FIELD_NUMBER: _ClassVar[int]
|
|
17
|
+
POWER_REACTIVE_DELIVERED_TO_CLIENT_KVAR_FIELD_NUMBER: _ClassVar[int]
|
|
18
|
+
POWER_REACTIVE_DELIVERED_BY_CLIENT_KVAR_FIELD_NUMBER: _ClassVar[int]
|
|
19
|
+
POWER_ACTIVE_L1_DELIVERED_TO_CLIENT_KW_FIELD_NUMBER: _ClassVar[int]
|
|
20
|
+
POWER_ACTIVE_L1_DELIVERED_BY_CLIENT_KW_FIELD_NUMBER: _ClassVar[int]
|
|
21
|
+
POWER_ACTIVE_L2_DELIVERED_TO_CLIENT_KW_FIELD_NUMBER: _ClassVar[int]
|
|
22
|
+
POWER_ACTIVE_L2_DELIVERED_BY_CLIENT_KW_FIELD_NUMBER: _ClassVar[int]
|
|
23
|
+
POWER_ACTIVE_L3_DELIVERED_TO_CLIENT_KW_FIELD_NUMBER: _ClassVar[int]
|
|
24
|
+
POWER_ACTIVE_L3_DELIVERED_BY_CLIENT_KW_FIELD_NUMBER: _ClassVar[int]
|
|
25
|
+
POWER_REACTIVE_L1_DELIVERED_TO_CLIENT_KVAR_FIELD_NUMBER: _ClassVar[int]
|
|
26
|
+
POWER_REACTIVE_L1_DELIVERED_BY_CLIENT_KVAR_FIELD_NUMBER: _ClassVar[int]
|
|
27
|
+
POWER_REACTIVE_L2_DELIVERED_TO_CLIENT_KVAR_FIELD_NUMBER: _ClassVar[int]
|
|
28
|
+
POWER_REACTIVE_L2_DELIVERED_BY_CLIENT_KVAR_FIELD_NUMBER: _ClassVar[int]
|
|
29
|
+
POWER_REACTIVE_L3_DELIVERED_TO_CLIENT_KVAR_FIELD_NUMBER: _ClassVar[int]
|
|
30
|
+
POWER_REACTIVE_L3_DELIVERED_BY_CLIENT_KVAR_FIELD_NUMBER: _ClassVar[int]
|
|
31
|
+
PHASE_VOLTAGE_L1_V_FIELD_NUMBER: _ClassVar[int]
|
|
32
|
+
PHASE_VOLTAGE_L2_V_FIELD_NUMBER: _ClassVar[int]
|
|
33
|
+
PHASE_VOLTAGE_L3_V_FIELD_NUMBER: _ClassVar[int]
|
|
34
|
+
PHASE_CURRENT_L1_A_FIELD_NUMBER: _ClassVar[int]
|
|
35
|
+
PHASE_CURRENT_L2_A_FIELD_NUMBER: _ClassVar[int]
|
|
36
|
+
PHASE_CURRENT_L3_A_FIELD_NUMBER: _ClassVar[int]
|
|
37
|
+
timestamp_utc_meter_s: int
|
|
38
|
+
timestamp_utc_ntp_s: int
|
|
39
|
+
energy_active_delivered_to_client_kwh: float
|
|
40
|
+
energy_active_delivered_by_client_kwh: float
|
|
41
|
+
energy_reactive_delivered_to_client_kvarh: float
|
|
42
|
+
energy_reactive_delivered_by_client_kvarh: float
|
|
43
|
+
power_active_delivered_to_client_kw: float
|
|
44
|
+
power_active_delivered_by_client_kw: float
|
|
45
|
+
power_reactive_delivered_to_client_kvar: float
|
|
46
|
+
power_reactive_delivered_by_client_kvar: float
|
|
47
|
+
power_active_l1_delivered_to_client_kw: float
|
|
48
|
+
power_active_l1_delivered_by_client_kw: float
|
|
49
|
+
power_active_l2_delivered_to_client_kw: float
|
|
50
|
+
power_active_l2_delivered_by_client_kw: float
|
|
51
|
+
power_active_l3_delivered_to_client_kw: float
|
|
52
|
+
power_active_l3_delivered_by_client_kw: float
|
|
53
|
+
power_reactive_l1_delivered_to_client_kvar: float
|
|
54
|
+
power_reactive_l1_delivered_by_client_kvar: float
|
|
55
|
+
power_reactive_l2_delivered_to_client_kvar: float
|
|
56
|
+
power_reactive_l2_delivered_by_client_kvar: float
|
|
57
|
+
power_reactive_l3_delivered_to_client_kvar: float
|
|
58
|
+
power_reactive_l3_delivered_by_client_kvar: float
|
|
59
|
+
phase_voltage_l1_v: float
|
|
60
|
+
phase_voltage_l2_v: float
|
|
61
|
+
phase_voltage_l3_v: float
|
|
62
|
+
phase_current_l1_a: float
|
|
63
|
+
phase_current_l2_a: float
|
|
64
|
+
phase_current_l3_a: float
|
|
65
|
+
def __init__(self, timestamp_utc_meter_s: _Optional[int] = ..., timestamp_utc_ntp_s: _Optional[int] = ..., energy_active_delivered_to_client_kwh: _Optional[float] = ..., energy_active_delivered_by_client_kwh: _Optional[float] = ..., energy_reactive_delivered_to_client_kvarh: _Optional[float] = ..., energy_reactive_delivered_by_client_kvarh: _Optional[float] = ..., power_active_delivered_to_client_kw: _Optional[float] = ..., power_active_delivered_by_client_kw: _Optional[float] = ..., power_reactive_delivered_to_client_kvar: _Optional[float] = ..., power_reactive_delivered_by_client_kvar: _Optional[float] = ..., power_active_l1_delivered_to_client_kw: _Optional[float] = ..., power_active_l1_delivered_by_client_kw: _Optional[float] = ..., power_active_l2_delivered_to_client_kw: _Optional[float] = ..., power_active_l2_delivered_by_client_kw: _Optional[float] = ..., power_active_l3_delivered_to_client_kw: _Optional[float] = ..., power_active_l3_delivered_by_client_kw: _Optional[float] = ..., power_reactive_l1_delivered_to_client_kvar: _Optional[float] = ..., power_reactive_l1_delivered_by_client_kvar: _Optional[float] = ..., power_reactive_l2_delivered_to_client_kvar: _Optional[float] = ..., power_reactive_l2_delivered_by_client_kvar: _Optional[float] = ..., power_reactive_l3_delivered_to_client_kvar: _Optional[float] = ..., power_reactive_l3_delivered_by_client_kvar: _Optional[float] = ..., phase_voltage_l1_v: _Optional[float] = ..., phase_voltage_l2_v: _Optional[float] = ..., phase_voltage_l3_v: _Optional[float] = ..., phase_current_l1_a: _Optional[float] = ..., phase_current_l2_a: _Optional[float] = ..., phase_current_l3_a: _Optional[float] = ...) -> None: ...
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: powerhub.proto
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
31,
|
|
16
|
+
1,
|
|
17
|
+
'',
|
|
18
|
+
'powerhub.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
from . import han_port_pb2 as han__port__pb2
|
|
26
|
+
from . import device_info_pb2 as device__info__pb2
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0epowerhub.proto\x12\x08powerhub\x1a\x0ehan_port.proto\x1a\x11\x64\x65vice_info.proto\"\xcc\x01\n\nDiagnostic\x12!\n\x04type\x18\x01 \x01(\x0e\x32\x13.powerhub.EventType\x12\x10\n\x08uptime_s\x18\x02 \x01(\x04\x12\x15\n\rwifi_rssi_dbm\x18\x03 \x01(\x05\x12,\n\x0b\x64\x65vice_info\x18\x04 \x01(\x0b\x32\x17.device_info.DeviceInfo\x12#\n\x1bhan_msg_successfully_parsed\x18\x05 \x01(\r\x12\x1f\n\x17han_msg_buffer_overflow\x18\x06 \x01(\r\"k\n\x07Payload\x12)\n\x06sample\x18\x01 \x01(\x0b\x32\x17.han_port.HanPortSampleH\x00\x12*\n\ndiagnostic\x18\x02 \x01(\x0b\x32\x14.powerhub.DiagnosticH\x00\x42\t\n\x07payload*\x9b\x02\n\tEventType\x12\x1a\n\x16\x45VENT_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10\x45VENT_TYPE_TIMER\x10\x01\x12%\n!EVENT_TYPE_PROVISIONING_REQUESTED\x10\x02\x12\x1d\n\x19\x45VENT_TYPE_MQTT_CONNECTED\x10\x03\x12\x1f\n\x1b\x45VENT_TYPE_REBOOT_REQUESTED\x10\x04\x12\x1b\n\x17\x45VENT_TYPE_BOOT_UNKNOWN\x10\x05\x12\x1c\n\x18\x45VENT_TYPE_BOOT_SOFTWARE\x10\x06\x12\x1c\n\x18\x45VENT_TYPE_BOOT_POWER_ON\x10\x07\x12\x1c\n\x18\x45VENT_TYPE_BOOT_WATCHDOG\x10\x08\x62\x06proto3')
|
|
30
|
+
|
|
31
|
+
_globals = globals()
|
|
32
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
33
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'powerhub_pb2', _globals)
|
|
34
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
35
|
+
DESCRIPTOR._loaded_options = None
|
|
36
|
+
_globals['_EVENTTYPE']._serialized_start=380
|
|
37
|
+
_globals['_EVENTTYPE']._serialized_end=663
|
|
38
|
+
_globals['_DIAGNOSTIC']._serialized_start=64
|
|
39
|
+
_globals['_DIAGNOSTIC']._serialized_end=268
|
|
40
|
+
_globals['_PAYLOAD']._serialized_start=270
|
|
41
|
+
_globals['_PAYLOAD']._serialized_end=377
|
|
42
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import han_port_pb2 as _han_port_pb2
|
|
2
|
+
import device_info_pb2 as _device_info_pb2
|
|
3
|
+
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
|
|
4
|
+
from google.protobuf import descriptor as _descriptor
|
|
5
|
+
from google.protobuf import message as _message
|
|
6
|
+
from collections.abc import Mapping as _Mapping
|
|
7
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
|
|
8
|
+
|
|
9
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
10
|
+
|
|
11
|
+
class EventType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
12
|
+
__slots__ = ()
|
|
13
|
+
EVENT_TYPE_UNSPECIFIED: _ClassVar[EventType]
|
|
14
|
+
EVENT_TYPE_TIMER: _ClassVar[EventType]
|
|
15
|
+
EVENT_TYPE_PROVISIONING_REQUESTED: _ClassVar[EventType]
|
|
16
|
+
EVENT_TYPE_MQTT_CONNECTED: _ClassVar[EventType]
|
|
17
|
+
EVENT_TYPE_REBOOT_REQUESTED: _ClassVar[EventType]
|
|
18
|
+
EVENT_TYPE_BOOT_UNKNOWN: _ClassVar[EventType]
|
|
19
|
+
EVENT_TYPE_BOOT_SOFTWARE: _ClassVar[EventType]
|
|
20
|
+
EVENT_TYPE_BOOT_POWER_ON: _ClassVar[EventType]
|
|
21
|
+
EVENT_TYPE_BOOT_WATCHDOG: _ClassVar[EventType]
|
|
22
|
+
EVENT_TYPE_UNSPECIFIED: EventType
|
|
23
|
+
EVENT_TYPE_TIMER: EventType
|
|
24
|
+
EVENT_TYPE_PROVISIONING_REQUESTED: EventType
|
|
25
|
+
EVENT_TYPE_MQTT_CONNECTED: EventType
|
|
26
|
+
EVENT_TYPE_REBOOT_REQUESTED: EventType
|
|
27
|
+
EVENT_TYPE_BOOT_UNKNOWN: EventType
|
|
28
|
+
EVENT_TYPE_BOOT_SOFTWARE: EventType
|
|
29
|
+
EVENT_TYPE_BOOT_POWER_ON: EventType
|
|
30
|
+
EVENT_TYPE_BOOT_WATCHDOG: EventType
|
|
31
|
+
|
|
32
|
+
class Diagnostic(_message.Message):
|
|
33
|
+
__slots__ = ("type", "uptime_s", "wifi_rssi_dbm", "device_info", "han_msg_successfully_parsed", "han_msg_buffer_overflow")
|
|
34
|
+
TYPE_FIELD_NUMBER: _ClassVar[int]
|
|
35
|
+
UPTIME_S_FIELD_NUMBER: _ClassVar[int]
|
|
36
|
+
WIFI_RSSI_DBM_FIELD_NUMBER: _ClassVar[int]
|
|
37
|
+
DEVICE_INFO_FIELD_NUMBER: _ClassVar[int]
|
|
38
|
+
HAN_MSG_SUCCESSFULLY_PARSED_FIELD_NUMBER: _ClassVar[int]
|
|
39
|
+
HAN_MSG_BUFFER_OVERFLOW_FIELD_NUMBER: _ClassVar[int]
|
|
40
|
+
type: EventType
|
|
41
|
+
uptime_s: int
|
|
42
|
+
wifi_rssi_dbm: int
|
|
43
|
+
device_info: _device_info_pb2.DeviceInfo
|
|
44
|
+
han_msg_successfully_parsed: int
|
|
45
|
+
han_msg_buffer_overflow: int
|
|
46
|
+
def __init__(self, type: _Optional[_Union[EventType, str]] = ..., uptime_s: _Optional[int] = ..., wifi_rssi_dbm: _Optional[int] = ..., device_info: _Optional[_Union[_device_info_pb2.DeviceInfo, _Mapping]] = ..., han_msg_successfully_parsed: _Optional[int] = ..., han_msg_buffer_overflow: _Optional[int] = ...) -> None: ...
|
|
47
|
+
|
|
48
|
+
class Payload(_message.Message):
|
|
49
|
+
__slots__ = ("sample", "diagnostic")
|
|
50
|
+
SAMPLE_FIELD_NUMBER: _ClassVar[int]
|
|
51
|
+
DIAGNOSTIC_FIELD_NUMBER: _ClassVar[int]
|
|
52
|
+
sample: _han_port_pb2.HanPortSample
|
|
53
|
+
diagnostic: Diagnostic
|
|
54
|
+
def __init__(self, sample: _Optional[_Union[_han_port_pb2.HanPortSample, _Mapping]] = ..., diagnostic: _Optional[_Union[Diagnostic, _Mapping]] = ...) -> None: ...
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package device_info;
|
|
4
|
+
|
|
5
|
+
option java_multiple_files = true;
|
|
6
|
+
option java_package = "io.bitvis.power.interfaces.powerhub.deviceinfo.protobuf";
|
|
7
|
+
|
|
8
|
+
message DeviceInfo {
|
|
9
|
+
bytes mac_address = 1;
|
|
10
|
+
string model_name = 2;
|
|
11
|
+
string sw_version = 3;
|
|
12
|
+
uint32 hw_revision = 4;
|
|
13
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package diagnostic;
|
|
4
|
+
|
|
5
|
+
import "device_info.proto";
|
|
6
|
+
|
|
7
|
+
option java_multiple_files = true;
|
|
8
|
+
option java_package = "io.bitvis.power.interfaces.powerhub.diagnostic.protobuf";
|
|
9
|
+
|
|
10
|
+
enum EventType {
|
|
11
|
+
EVENT_TYPE_UNSPECIFIED = 0;
|
|
12
|
+
EVENT_TYPE_TIMER = 1;
|
|
13
|
+
EVENT_TYPE_PROVISIONING_REQUESTED = 2;
|
|
14
|
+
EVENT_TYPE_MQTT_CONNECTED = 3;
|
|
15
|
+
EVENT_TYPE_REBOOT_REQUESTED = 4;
|
|
16
|
+
EVENT_TYPE_BOOT_UNKNOWN = 5;
|
|
17
|
+
EVENT_TYPE_BOOT_SOFTWARE = 6;
|
|
18
|
+
EVENT_TYPE_BOOT_POWER_ON = 7;
|
|
19
|
+
EVENT_TYPE_BOOT_WATCHDOG = 8;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
message Counters {
|
|
23
|
+
uint32 hawkbit_status_connection_error = 1;
|
|
24
|
+
uint32 hawkbit_status_unconfirmed_image = 2 [ deprecated = true ];
|
|
25
|
+
uint32 hawkbit_status_metadata_error = 3 [ deprecated = true ];
|
|
26
|
+
uint32 hawkbit_status_download_error = 4;
|
|
27
|
+
uint32 hawkbit_status_already_updated = 5 [ deprecated = true ];
|
|
28
|
+
uint32 hawkbit_status_update_downloaded = 6;
|
|
29
|
+
uint32 hawkbit_status_no_update = 7;
|
|
30
|
+
uint32 hawkbit_status_cancel_update = 8 [ deprecated = true ];
|
|
31
|
+
uint32 hawkbit_status_probe_in_progress = 9 [ deprecated = true ];
|
|
32
|
+
|
|
33
|
+
uint32 timeout_internet_unreachable = 10;
|
|
34
|
+
uint32 timeout_hawkbit_connection = 11;
|
|
35
|
+
|
|
36
|
+
uint32 han_msg_successfully_parsed = 12;
|
|
37
|
+
uint32 han_msg_buffer_overflow = 13;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
message Diagnostic {
|
|
41
|
+
EventType type = 1;
|
|
42
|
+
uint64 uptime_s = 2;
|
|
43
|
+
int32 wifi_rssi_dbm = 3;
|
|
44
|
+
device_info.DeviceInfo device_info = 4;
|
|
45
|
+
Counters counters = 5;
|
|
46
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package han_port;
|
|
4
|
+
|
|
5
|
+
message HanPortSample {
|
|
6
|
+
optional uint64 timestamp_utc_meter_s = 1;
|
|
7
|
+
optional uint64 timestamp_utc_ntp_s = 28;
|
|
8
|
+
|
|
9
|
+
optional float energy_active_delivered_to_client_kwh = 2;
|
|
10
|
+
optional float energy_active_delivered_by_client_kwh = 3;
|
|
11
|
+
|
|
12
|
+
optional float energy_reactive_delivered_to_client_kvarh = 4;
|
|
13
|
+
optional float energy_reactive_delivered_by_client_kvarh = 5;
|
|
14
|
+
|
|
15
|
+
optional float power_active_delivered_to_client_kw = 6;
|
|
16
|
+
optional float power_active_delivered_by_client_kw = 7;
|
|
17
|
+
|
|
18
|
+
optional float power_reactive_delivered_to_client_kvar = 8;
|
|
19
|
+
optional float power_reactive_delivered_by_client_kvar = 9;
|
|
20
|
+
|
|
21
|
+
optional float power_active_l1_delivered_to_client_kw = 10;
|
|
22
|
+
optional float power_active_l1_delivered_by_client_kw = 11;
|
|
23
|
+
optional float power_active_l2_delivered_to_client_kw = 12;
|
|
24
|
+
optional float power_active_l2_delivered_by_client_kw = 13;
|
|
25
|
+
optional float power_active_l3_delivered_to_client_kw = 14;
|
|
26
|
+
optional float power_active_l3_delivered_by_client_kw = 15;
|
|
27
|
+
|
|
28
|
+
optional float power_reactive_l1_delivered_to_client_kvar = 16;
|
|
29
|
+
optional float power_reactive_l1_delivered_by_client_kvar = 17;
|
|
30
|
+
optional float power_reactive_l2_delivered_to_client_kvar = 18;
|
|
31
|
+
optional float power_reactive_l2_delivered_by_client_kvar = 19;
|
|
32
|
+
optional float power_reactive_l3_delivered_to_client_kvar = 20;
|
|
33
|
+
optional float power_reactive_l3_delivered_by_client_kvar = 21;
|
|
34
|
+
|
|
35
|
+
optional float phase_voltage_l1_v = 22;
|
|
36
|
+
optional float phase_voltage_l2_v = 23;
|
|
37
|
+
optional float phase_voltage_l3_v = 24;
|
|
38
|
+
|
|
39
|
+
optional float phase_current_l1_a = 25;
|
|
40
|
+
optional float phase_current_l2_a = 26;
|
|
41
|
+
optional float phase_current_l3_a = 27;
|
|
42
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
import "han_port.proto";
|
|
4
|
+
import "device_info.proto";
|
|
5
|
+
|
|
6
|
+
package powerhub;
|
|
7
|
+
|
|
8
|
+
enum EventType {
|
|
9
|
+
EVENT_TYPE_UNSPECIFIED = 0;
|
|
10
|
+
EVENT_TYPE_TIMER = 1;
|
|
11
|
+
EVENT_TYPE_PROVISIONING_REQUESTED = 2;
|
|
12
|
+
EVENT_TYPE_MQTT_CONNECTED = 3;
|
|
13
|
+
EVENT_TYPE_REBOOT_REQUESTED = 4;
|
|
14
|
+
EVENT_TYPE_BOOT_UNKNOWN = 5;
|
|
15
|
+
EVENT_TYPE_BOOT_SOFTWARE = 6;
|
|
16
|
+
EVENT_TYPE_BOOT_POWER_ON = 7;
|
|
17
|
+
EVENT_TYPE_BOOT_WATCHDOG = 8;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
message Diagnostic {
|
|
21
|
+
EventType type = 1;
|
|
22
|
+
uint64 uptime_s = 2;
|
|
23
|
+
int32 wifi_rssi_dbm = 3;
|
|
24
|
+
device_info.DeviceInfo device_info = 4;
|
|
25
|
+
uint32 han_msg_successfully_parsed = 5;
|
|
26
|
+
uint32 han_msg_buffer_overflow = 6;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
message Payload {
|
|
30
|
+
oneof payload {
|
|
31
|
+
han_port.HanPortSample sample = 1;
|
|
32
|
+
Diagnostic diagnostic = 2;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# PEP 561 marker file for type checking support
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bitvis-protobuf
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Protobuf definitions for Bitvis Power Hub
|
|
5
|
+
Author-email: Mandus Borjesson <mandus@example.com>
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/MandusBorjesson/bitvis-protobuf
|
|
8
|
+
Project-URL: Repository, https://github.com/MandusBorjesson/bitvis-protobuf
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Requires-Python: >=3.11
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Requires-Dist: protobuf>=4.25.0
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
|
|
22
|
+
# Bitvis Protobuf
|
|
23
|
+
|
|
24
|
+
Python protobuf definitions for Bitvis Power Hub communication.
|
|
25
|
+
|
|
26
|
+
## Description
|
|
27
|
+
|
|
28
|
+
This library contains the Protocol Buffer definitions and generated Python code for communicating with Bitvis Power Hub devices. It includes message definitions for:
|
|
29
|
+
|
|
30
|
+
- Device information
|
|
31
|
+
- Diagnostic data
|
|
32
|
+
- HAN port samples
|
|
33
|
+
- Power hub payloads
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install bitvis-protobuf
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Usage
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
from bitvis_protobuf import powerhub_pb2, han_port_pb2, diagnostic_pb2
|
|
45
|
+
|
|
46
|
+
# Parse a payload
|
|
47
|
+
payload = powerhub_pb2.Payload()
|
|
48
|
+
payload.ParseFromString(data)
|
|
49
|
+
|
|
50
|
+
if payload.HasField("sample"):
|
|
51
|
+
sample = payload.sample
|
|
52
|
+
# Process HAN port sample data
|
|
53
|
+
|
|
54
|
+
elif payload.HasField("diagnostic"):
|
|
55
|
+
diagnostic = payload.diagnostic
|
|
56
|
+
# Process diagnostic data
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Development
|
|
60
|
+
|
|
61
|
+
### Building from source
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Install development dependencies
|
|
65
|
+
pip install -e ".[dev]"
|
|
66
|
+
|
|
67
|
+
# Generate protobuf code
|
|
68
|
+
python -m build_proto
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Regenerating protobuf code
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
python scripts/generate_proto.py
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
Apache License 2.0
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
MANIFEST.in
|
|
3
|
+
README.md
|
|
4
|
+
pyproject.toml
|
|
5
|
+
src/bitvis_protobuf/__init__.py
|
|
6
|
+
src/bitvis_protobuf/device_info_pb2.py
|
|
7
|
+
src/bitvis_protobuf/device_info_pb2.pyi
|
|
8
|
+
src/bitvis_protobuf/diagnostic_pb2.py
|
|
9
|
+
src/bitvis_protobuf/diagnostic_pb2.pyi
|
|
10
|
+
src/bitvis_protobuf/han_port_pb2.py
|
|
11
|
+
src/bitvis_protobuf/han_port_pb2.pyi
|
|
12
|
+
src/bitvis_protobuf/powerhub_pb2.py
|
|
13
|
+
src/bitvis_protobuf/powerhub_pb2.pyi
|
|
14
|
+
src/bitvis_protobuf/py.typed
|
|
15
|
+
src/bitvis_protobuf.egg-info/PKG-INFO
|
|
16
|
+
src/bitvis_protobuf.egg-info/SOURCES.txt
|
|
17
|
+
src/bitvis_protobuf.egg-info/dependency_links.txt
|
|
18
|
+
src/bitvis_protobuf.egg-info/requires.txt
|
|
19
|
+
src/bitvis_protobuf.egg-info/top_level.txt
|
|
20
|
+
src/bitvis_protobuf/proto/device_info.proto
|
|
21
|
+
src/bitvis_protobuf/proto/diagnostic.proto
|
|
22
|
+
src/bitvis_protobuf/proto/han_port.proto
|
|
23
|
+
src/bitvis_protobuf/proto/powerhub.proto
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
protobuf>=4.25.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
bitvis_protobuf
|