frequenz-client-microgrid 0.18.1__tar.gz → 0.18.3__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.
Files changed (67) hide show
  1. {frequenz_client_microgrid-0.18.1/src/frequenz_client_microgrid.egg-info → frequenz_client_microgrid-0.18.3}/PKG-INFO +27 -27
  2. frequenz_client_microgrid-0.18.3/RELEASE_NOTES.md +5 -0
  3. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/pyproject.toml +28 -27
  4. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/__init__.py +0 -1
  5. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/_client.py +130 -11
  6. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/_lifetime.py +0 -1
  7. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/_location.py +0 -1
  8. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/_microgrid_info_proto.py +0 -1
  9. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/__init__.py +2 -0
  10. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_category.py +3 -0
  11. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_component_proto.py +4 -0
  12. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_data_samples_proto.py +0 -1
  13. frequenz_client_microgrid-0.18.3/src/frequenz/client/microgrid/component/_steam_boiler.py +18 -0
  14. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_types.py +2 -0
  15. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/metrics/_bounds_proto.py +0 -1
  16. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/metrics/_metric.py +0 -1
  17. frequenz_client_microgrid-0.18.3/src/frequenz/client/microgrid/sensor/__init__.py +48 -0
  18. frequenz_client_microgrid-0.18.3/src/frequenz/client/microgrid/sensor/_sensor.py +57 -0
  19. frequenz_client_microgrid-0.18.3/src/frequenz/client/microgrid/sensor/_sensor_proto.py +93 -0
  20. frequenz_client_microgrid-0.18.3/src/frequenz/client/microgrid/sensor/_state.py +84 -0
  21. frequenz_client_microgrid-0.18.3/src/frequenz/client/microgrid/sensor/_state_proto.py +75 -0
  22. frequenz_client_microgrid-0.18.3/src/frequenz/client/microgrid/sensor/_telemetry.py +33 -0
  23. frequenz_client_microgrid-0.18.3/src/frequenz/client/microgrid/sensor/_telemetry_proto.py +49 -0
  24. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3/src/frequenz_client_microgrid.egg-info}/PKG-INFO +27 -27
  25. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz_client_microgrid.egg-info/SOURCES.txt +8 -0
  26. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz_client_microgrid.egg-info/requires.txt +25 -24
  27. frequenz_client_microgrid-0.18.1/RELEASE_NOTES.md +0 -13
  28. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/LICENSE +0 -0
  29. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/MANIFEST.in +0 -0
  30. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/README.md +0 -0
  31. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/setup.cfg +0 -0
  32. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/_delivery_area.py +0 -0
  33. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/_delivery_area_proto.py +0 -0
  34. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/_exception.py +0 -0
  35. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/_lifetime_proto.py +0 -0
  36. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/_location_proto.py +0 -0
  37. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/_microgrid_info.py +0 -0
  38. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/_util.py +0 -0
  39. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_battery.py +0 -0
  40. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_chp.py +0 -0
  41. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_component.py +0 -0
  42. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_connection.py +0 -0
  43. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_connection_proto.py +0 -0
  44. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_converter.py +0 -0
  45. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_crypto_miner.py +0 -0
  46. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_data_samples.py +0 -0
  47. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_electrolyzer.py +0 -0
  48. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_ev_charger.py +0 -0
  49. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_grid_connection_point.py +0 -0
  50. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_hvac.py +0 -0
  51. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_inverter.py +0 -0
  52. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_meter.py +0 -0
  53. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_precharger.py +0 -0
  54. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_problematic.py +0 -0
  55. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_relay.py +0 -0
  56. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_state_sample.py +0 -0
  57. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_state_sample_proto.py +0 -0
  58. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_voltage_transformer.py +0 -0
  59. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/component/_wind_turbine.py +0 -0
  60. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/conftest.py +0 -0
  61. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/metrics/__init__.py +0 -0
  62. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/metrics/_bounds.py +0 -0
  63. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/metrics/_sample.py +0 -0
  64. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/metrics/_sample_proto.py +0 -0
  65. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz/client/microgrid/py.typed +0 -0
  66. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz_client_microgrid.egg-info/dependency_links.txt +0 -0
  67. {frequenz_client_microgrid-0.18.1 → frequenz_client_microgrid-0.18.3}/src/frequenz_client_microgrid.egg-info/top_level.txt +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: frequenz-client-microgrid
3
- Version: 0.18.1
3
+ Version: 0.18.3
4
4
  Summary: Microgrid API client for Python
5
5
  Author-email: Frequenz Energy-as-a-Service GmbH <floss@frequenz.com>
6
- License: MIT
6
+ License-Expression: MIT
7
7
  Project-URL: Documentation, https://frequenz-floss.github.io/frequenz-client-microgrid-python/
8
8
  Project-URL: Changelog, https://github.com/frequenz-floss/frequenz-client-microgrid-python/releases
9
9
  Project-URL: Issues, https://github.com/frequenz-floss/frequenz-client-microgrid-python/issues
@@ -12,7 +12,6 @@ Project-URL: Support, https://github.com/frequenz-floss/frequenz-client-microgri
12
12
  Keywords: api,client,frequenz,grpc,lib,library,microgrid,python
13
13
  Classifier: Development Status :: 3 - Alpha
14
14
  Classifier: Intended Audience :: Developers
15
- Classifier: License :: OSI Approved :: MIT License
16
15
  Classifier: Programming Language :: Python :: 3
17
16
  Classifier: Programming Language :: Python :: 3 :: Only
18
17
  Classifier: Topic :: Internet
@@ -21,53 +20,54 @@ Classifier: Typing :: Typed
21
20
  Requires-Python: <4,>=3.11
22
21
  Description-Content-Type: text/markdown
23
22
  License-File: LICENSE
24
- Requires-Dist: frequenz-api-common<1.0.0,>=0.8.0
25
- Requires-Dist: frequenz-api-microgrid<0.19.0,>=0.18.0
23
+ Requires-Dist: frequenz-api-common<1.0.0,>=0.8.2
24
+ Requires-Dist: frequenz-api-microgrid<1,>=0.18.0
26
25
  Requires-Dist: frequenz-channels<2.0.0,>=1.6.1
27
26
  Requires-Dist: frequenz-client-base<0.12.0,>=0.10.0
28
27
  Requires-Dist: frequenz-client-common<0.4.0,>=0.3.6
29
28
  Requires-Dist: frequenz-core<2.0.0,>=1.3.0
30
- Requires-Dist: grpcio<2,>=1.72.1
31
- Requires-Dist: protobuf<7,>=6.31.1
29
+ Requires-Dist: grpcio<2,>=1.80.0
30
+ Requires-Dist: protobuf<8,>=6.33.6
32
31
  Requires-Dist: typing-extensions<5,>=4.13.0
33
32
  Provides-Extra: dev-flake8
34
33
  Requires-Dist: flake8==7.3.0; extra == "dev-flake8"
34
+ Requires-Dist: flake8-datetimez==20.10.0; extra == "dev-flake8"
35
35
  Requires-Dist: flake8-docstrings==1.7.0; extra == "dev-flake8"
36
36
  Requires-Dist: flake8-pyproject==1.2.4; extra == "dev-flake8"
37
37
  Requires-Dist: pydoclint==0.8.3; extra == "dev-flake8"
38
38
  Requires-Dist: pydocstyle==6.3.0; extra == "dev-flake8"
39
39
  Provides-Extra: dev-formatting
40
- Requires-Dist: black==25.12.0; extra == "dev-formatting"
41
- Requires-Dist: isort==7.0.0; extra == "dev-formatting"
40
+ Requires-Dist: black==26.3.1; extra == "dev-formatting"
41
+ Requires-Dist: isort==8.0.1; extra == "dev-formatting"
42
42
  Provides-Extra: dev-mkdocs
43
- Requires-Dist: black==25.12.0; extra == "dev-mkdocs"
44
- Requires-Dist: Markdown==3.10; extra == "dev-mkdocs"
45
- Requires-Dist: mike==2.1.3; extra == "dev-mkdocs"
46
- Requires-Dist: mkdocs-gen-files==0.6.0; extra == "dev-mkdocs"
47
- Requires-Dist: mkdocs-literate-nav==0.6.2; extra == "dev-mkdocs"
43
+ Requires-Dist: black==26.3.1; extra == "dev-mkdocs"
44
+ Requires-Dist: Markdown==3.10.2; extra == "dev-mkdocs"
45
+ Requires-Dist: mike==2.1.4; extra == "dev-mkdocs"
46
+ Requires-Dist: mkdocs-gen-files==0.6.1; extra == "dev-mkdocs"
47
+ Requires-Dist: mkdocs-literate-nav==0.6.3; extra == "dev-mkdocs"
48
48
  Requires-Dist: mkdocs-macros-plugin==1.5.0; extra == "dev-mkdocs"
49
- Requires-Dist: mkdocs-material==9.7.0; extra == "dev-mkdocs"
50
- Requires-Dist: mkdocstrings[python]==1.0.0; extra == "dev-mkdocs"
51
- Requires-Dist: mkdocstrings-python==1.18.2; extra == "dev-mkdocs"
52
- Requires-Dist: frequenz-repo-config[lib]==0.13.8; extra == "dev-mkdocs"
49
+ Requires-Dist: mkdocs-material==9.7.6; extra == "dev-mkdocs"
50
+ Requires-Dist: mkdocstrings[python]==1.0.3; extra == "dev-mkdocs"
51
+ Requires-Dist: mkdocstrings-python==2.0.3; extra == "dev-mkdocs"
52
+ Requires-Dist: frequenz-repo-config[lib]==0.16.0; extra == "dev-mkdocs"
53
53
  Provides-Extra: dev-mypy
54
- Requires-Dist: mypy==1.19.0; extra == "dev-mypy"
54
+ Requires-Dist: mypy==1.20.0; extra == "dev-mypy"
55
55
  Requires-Dist: grpc-stubs==1.53.0.6; extra == "dev-mypy"
56
- Requires-Dist: types-Markdown==3.10.0.20251106; extra == "dev-mypy"
57
- Requires-Dist: types-protobuf==6.32.1.20251105; extra == "dev-mypy"
56
+ Requires-Dist: types-Markdown==3.10.2.20260211; extra == "dev-mypy"
57
+ Requires-Dist: types-protobuf==6.32.1.20260221; extra == "dev-mypy"
58
58
  Requires-Dist: frequenz-client-microgrid[dev-mkdocs,dev-noxfile,dev-pytest]; extra == "dev-mypy"
59
59
  Provides-Extra: dev-noxfile
60
- Requires-Dist: nox==2025.11.12; extra == "dev-noxfile"
61
- Requires-Dist: frequenz-repo-config[lib]==0.13.8; extra == "dev-noxfile"
60
+ Requires-Dist: nox==2026.2.9; extra == "dev-noxfile"
61
+ Requires-Dist: frequenz-repo-config[lib]==0.16.0; extra == "dev-noxfile"
62
62
  Provides-Extra: dev-pylint
63
- Requires-Dist: pylint==4.0.4; extra == "dev-pylint"
63
+ Requires-Dist: pylint==4.0.5; extra == "dev-pylint"
64
64
  Requires-Dist: frequenz-client-microgrid[dev-mkdocs,dev-noxfile,dev-pytest]; extra == "dev-pylint"
65
65
  Provides-Extra: dev-pytest
66
- Requires-Dist: pytest==9.0.2; extra == "dev-pytest"
67
- Requires-Dist: frequenz-repo-config[extra-lint-examples]==0.13.8; extra == "dev-pytest"
66
+ Requires-Dist: pytest==9.0.3; extra == "dev-pytest"
67
+ Requires-Dist: frequenz-repo-config[extra-lint-examples]==0.16.0; extra == "dev-pytest"
68
68
  Requires-Dist: pytest-mock==3.15.1; extra == "dev-pytest"
69
69
  Requires-Dist: pytest-asyncio==1.3.0; extra == "dev-pytest"
70
- Requires-Dist: async-solipsism==0.8; extra == "dev-pytest"
70
+ Requires-Dist: async-solipsism==0.9; extra == "dev-pytest"
71
71
  Provides-Extra: dev
72
72
  Requires-Dist: frequenz-client-microgrid[dev-flake8,dev-formatting,dev-mkdocs,dev-mypy,dev-noxfile,dev-pylint,dev-pytest]; extra == "dev"
73
73
  Dynamic: license-file
@@ -0,0 +1,5 @@
1
+ # Frequenz Microgrid API Client Release Notes
2
+
3
+ ## New Features
4
+
5
+ A new component type, SteamBoiler, was added. Also added a new component category for it.
@@ -3,9 +3,9 @@
3
3
 
4
4
  [build-system]
5
5
  requires = [
6
- "setuptools == 80.9.0",
7
- "setuptools_scm[toml] == 9.2.2",
8
- "frequenz-repo-config[lib] == 0.13.8",
6
+ "setuptools == 82.0.1",
7
+ "setuptools_scm[toml] == 10.0.5",
8
+ "frequenz-repo-config[lib] == 0.16.0",
9
9
  ]
10
10
  build-backend = "setuptools.build_meta"
11
11
 
@@ -13,7 +13,8 @@ build-backend = "setuptools.build_meta"
13
13
  name = "frequenz-client-microgrid"
14
14
  description = "Microgrid API client for Python"
15
15
  readme = "README.md"
16
- license = { text = "MIT" }
16
+ license = "MIT"
17
+ license-files = ["LICENSE"]
17
18
  keywords = [
18
19
  "api",
19
20
  "client",
@@ -27,7 +28,6 @@ keywords = [
27
28
  classifiers = [
28
29
  "Development Status :: 3 - Alpha",
29
30
  "Intended Audience :: Developers",
30
- "License :: OSI Approved :: MIT License",
31
31
  "Programming Language :: Python :: 3",
32
32
  "Programming Language :: Python :: 3 :: Only",
33
33
  "Topic :: Internet",
@@ -36,14 +36,14 @@ classifiers = [
36
36
  ]
37
37
  requires-python = ">= 3.11, < 4"
38
38
  dependencies = [
39
- "frequenz-api-common >= 0.8.0, < 1.0.0",
40
- "frequenz-api-microgrid >= 0.18.0, < 0.19.0",
39
+ "frequenz-api-common >= 0.8.2, < 1.0.0",
40
+ "frequenz-api-microgrid >= 0.18.0, < 1",
41
41
  "frequenz-channels >= 1.6.1, < 2.0.0",
42
42
  "frequenz-client-base >= 0.10.0, < 0.12.0",
43
43
  "frequenz-client-common >= 0.3.6, < 0.4.0",
44
44
  "frequenz-core >= 1.3.0, < 2.0.0",
45
- "grpcio >= 1.72.1, < 2",
46
- "protobuf >= 6.31.1, < 7",
45
+ "grpcio >= 1.80.0, < 2",
46
+ "protobuf >= 6.33.6, < 8",
47
47
  "typing-extensions >= 4.13.0, < 5",
48
48
  ]
49
49
  dynamic = ["version"]
@@ -55,44 +55,45 @@ email = "floss@frequenz.com"
55
55
  [project.optional-dependencies]
56
56
  dev-flake8 = [
57
57
  "flake8 == 7.3.0",
58
+ "flake8-datetimez == 20.10.0",
58
59
  "flake8-docstrings == 1.7.0",
59
60
  "flake8-pyproject == 1.2.4", # For reading the flake8 config from pyproject.toml
60
61
  "pydoclint == 0.8.3",
61
62
  "pydocstyle == 6.3.0",
62
63
  ]
63
- dev-formatting = ["black == 25.12.0", "isort == 7.0.0"]
64
+ dev-formatting = ["black == 26.3.1", "isort == 8.0.1"]
64
65
  dev-mkdocs = [
65
- "black == 25.12.0",
66
- "Markdown==3.10",
67
- "mike == 2.1.3",
68
- "mkdocs-gen-files == 0.6.0",
69
- "mkdocs-literate-nav == 0.6.2",
66
+ "black == 26.3.1",
67
+ "Markdown==3.10.2",
68
+ "mike == 2.1.4",
69
+ "mkdocs-gen-files == 0.6.1",
70
+ "mkdocs-literate-nav == 0.6.3",
70
71
  "mkdocs-macros-plugin == 1.5.0",
71
- "mkdocs-material == 9.7.0",
72
- "mkdocstrings[python] == 1.0.0",
73
- "mkdocstrings-python == 1.18.2",
74
- "frequenz-repo-config[lib] == 0.13.8",
72
+ "mkdocs-material == 9.7.6",
73
+ "mkdocstrings[python] == 1.0.3",
74
+ "mkdocstrings-python == 2.0.3",
75
+ "frequenz-repo-config[lib] == 0.16.0",
75
76
  ]
76
77
  dev-mypy = [
77
- "mypy == 1.19.0",
78
+ "mypy == 1.20.0",
78
79
  "grpc-stubs == 1.53.0.6",
79
- "types-Markdown == 3.10.0.20251106",
80
- "types-protobuf == 6.32.1.20251105",
80
+ "types-Markdown == 3.10.2.20260211",
81
+ "types-protobuf == 6.32.1.20260221",
81
82
  # For checking the noxfile, docs/ script, and tests
82
83
  "frequenz-client-microgrid[dev-mkdocs,dev-noxfile,dev-pytest]",
83
84
  ]
84
- dev-noxfile = ["nox == 2025.11.12", "frequenz-repo-config[lib] == 0.13.8"]
85
+ dev-noxfile = ["nox == 2026.2.9", "frequenz-repo-config[lib] == 0.16.0"]
85
86
  dev-pylint = [
86
- "pylint == 4.0.4",
87
+ "pylint == 4.0.5",
87
88
  # For checking the noxfile, docs/ script, and tests
88
89
  "frequenz-client-microgrid[dev-mkdocs,dev-noxfile,dev-pytest]",
89
90
  ]
90
91
  dev-pytest = [
91
- "pytest == 9.0.2",
92
- "frequenz-repo-config[extra-lint-examples] == 0.13.8",
92
+ "pytest == 9.0.3",
93
+ "frequenz-repo-config[extra-lint-examples] == 0.16.0",
93
94
  "pytest-mock == 3.15.1",
94
95
  "pytest-asyncio == 1.3.0",
95
- "async-solipsism == 0.8",
96
+ "async-solipsism == 0.9",
96
97
  ]
97
98
  dev = [
98
99
  "frequenz-client-microgrid[dev-mkdocs,dev-flake8,dev-formatting,dev-mkdocs,dev-mypy,dev-noxfile,dev-pylint,dev-pytest]",
@@ -6,7 +6,6 @@
6
6
  This package provides a low-level interface for interacting with the microgrid API.
7
7
  """
8
8
 
9
-
10
9
  from ._client import (
11
10
  DEFAULT_CHANNEL_OPTIONS,
12
11
  DEFAULT_GRPC_CALL_TIMEOUT,
@@ -12,7 +12,7 @@ import math
12
12
  from collections.abc import Iterable
13
13
  from dataclasses import replace
14
14
  from datetime import datetime, timedelta
15
- from typing import Any, assert_never
15
+ from typing import Any, assert_never, cast
16
16
 
17
17
  from frequenz.api.common.v1alpha8.metrics import bounds_pb2, metrics_pb2
18
18
  from frequenz.api.common.v1alpha8.microgrid.electrical_components import (
@@ -23,6 +23,7 @@ from frequenz.channels import Receiver
23
23
  from frequenz.client.base import channel, client, conversion, retry, streaming
24
24
  from frequenz.client.base.exception import ApiClientError
25
25
  from frequenz.client.common.microgrid.components import ComponentId
26
+ from frequenz.client.common.microgrid.sensors import SensorId
26
27
  from google.protobuf.empty_pb2 import Empty
27
28
  from grpc.aio import AioRpcError
28
29
  from typing_extensions import override
@@ -40,6 +41,10 @@ from .component._data_samples_proto import component_data_samples_from_proto
40
41
  from .component._types import ComponentTypes
41
42
  from .metrics._bounds import Bounds
42
43
  from .metrics._metric import Metric
44
+ from .sensor._sensor import Sensor
45
+ from .sensor._sensor_proto import sensor_from_proto
46
+ from .sensor._telemetry import SensorTelemetry
47
+ from .sensor._telemetry_proto import sensor_telemetry_from_proto
43
48
 
44
49
  DEFAULT_GRPC_CALL_TIMEOUT = 60.0
45
50
  """The default timeout for gRPC calls made by this client (in seconds)."""
@@ -100,7 +105,10 @@ class MicrogridApiClient(client.BaseApiClient[microgrid_pb2_grpc.MicrogridStub])
100
105
  ] = {}
101
106
  self._sensor_data_broadcasters: dict[
102
107
  str,
103
- streaming.GrpcStreamBroadcaster[Any, Any],
108
+ streaming.GrpcStreamBroadcaster[
109
+ microgrid_pb2.ReceiveSensorTelemetryStreamResponse,
110
+ SensorTelemetry,
111
+ ],
104
112
  ] = {}
105
113
  self._retry_strategy = retry_strategy
106
114
 
@@ -123,16 +131,19 @@ class MicrogridApiClient(client.BaseApiClient[microgrid_pb2_grpc.MicrogridStub])
123
131
  exc_tb: Any | None,
124
132
  ) -> bool | None:
125
133
  """Close the gRPC channel and stop all broadcasters."""
134
+ all_broadcasters = cast(
135
+ list[streaming.GrpcStreamBroadcaster[Any, Any]],
136
+ list(
137
+ itertools.chain(
138
+ self._component_data_broadcasters.values(),
139
+ self._sensor_data_broadcasters.values(),
140
+ )
141
+ ),
142
+ )
126
143
  exceptions = list(
127
144
  exc
128
145
  for exc in await asyncio.gather(
129
- *(
130
- broadcaster.stop()
131
- for broadcaster in itertools.chain(
132
- self._component_data_broadcasters.values(),
133
- self._sensor_data_broadcasters.values(),
134
- )
135
- ),
146
+ *(broadcaster.stop() for broadcaster in all_broadcasters),
136
147
  return_exceptions=True,
137
148
  )
138
149
  if isinstance(exc, BaseException)
@@ -213,7 +224,7 @@ class MicrogridApiClient(client.BaseApiClient[microgrid_pb2_grpc.MicrogridStub])
213
224
  Iterator whose elements are all the components in the local microgrid.
214
225
 
215
226
  Raises:
216
- ApiClientError: If the are any errors communicating with the Microgrid API,
227
+ ApiClientError: If there are any errors communicating with the Microgrid API,
217
228
  most likely a subclass of
218
229
  [GrpcError][frequenz.client.microgrid.GrpcError].
219
230
  """
@@ -269,7 +280,7 @@ class MicrogridApiClient(client.BaseApiClient[microgrid_pb2_grpc.MicrogridStub])
269
280
  Iterator whose elements are all the connections in the local microgrid.
270
281
 
271
282
  Raises:
272
- ApiClientError: If the are any errors communicating with the Microgrid API,
283
+ ApiClientError: If there are any errors communicating with the Microgrid API,
273
284
  most likely a subclass of
274
285
  [GrpcError][frequenz.client.microgrid.GrpcError].
275
286
  """
@@ -296,6 +307,41 @@ class MicrogridApiClient(client.BaseApiClient[microgrid_pb2_grpc.MicrogridStub])
296
307
  if conn is not None
297
308
  )
298
309
 
310
+ async def list_sensors( # noqa: DOC502 (raises ApiClientError indirectly)
311
+ self,
312
+ *,
313
+ sensors: Iterable[SensorId | Sensor] = (),
314
+ ) -> Iterable[Sensor]:
315
+ """Fetch all the sensors present in the local microgrid.
316
+
317
+ Sensors are devices that measure physical properties in the microgrid's
318
+ surroundings, such as temperature, humidity, and solar irradiance. Unlike
319
+ electrical components, sensors are not part of the electrical infrastructure.
320
+
321
+ Args:
322
+ sensors: The sensors to fetch. If empty, all sensors are fetched.
323
+
324
+ Returns:
325
+ Iterator whose elements are all the sensors in the local microgrid.
326
+
327
+ Raises:
328
+ ApiClientError: If there are any errors communicating with the Microgrid API,
329
+ most likely a subclass of
330
+ [GrpcError][frequenz.client.microgrid.GrpcError].
331
+ """
332
+ response = await client.call_stub_method(
333
+ self,
334
+ lambda: self.stub.ListSensors(
335
+ microgrid_pb2.ListSensorRequest(
336
+ sensor_ids=map(_get_sensor_id, sensors),
337
+ ),
338
+ timeout=DEFAULT_GRPC_CALL_TIMEOUT,
339
+ ),
340
+ method_name="ListSensors",
341
+ )
342
+
343
+ return map(sensor_from_proto, response.sensors)
344
+
299
345
  # pylint: disable-next=fixme
300
346
  # TODO: Unifi set_component_power_active and set_component_power_reactive, or at
301
347
  # least use a common implementation.
@@ -632,6 +678,68 @@ class MicrogridApiClient(client.BaseApiClient[microgrid_pb2_grpc.MicrogridStub])
632
678
  self._component_data_broadcasters[key] = broadcaster
633
679
  return broadcaster.new_receiver(maxsize=buffer_size)
634
680
 
681
+ def receive_sensor_telemetry_stream(
682
+ self,
683
+ sensor: SensorId | Sensor,
684
+ metrics: Iterable[Metric | int],
685
+ *,
686
+ buffer_size: int = 50,
687
+ ) -> Receiver[SensorTelemetry]:
688
+ """Stream telemetry data from a sensor.
689
+
690
+ At least one metric must be specified. If no metric is specified, then the
691
+ stream will raise an error.
692
+
693
+ Warning:
694
+ Sensors may not support all metrics. If a sensor does not support
695
+ a given metric, then the returned data stream will not contain that metric.
696
+
697
+ There is no way to tell if a metric is not being received because the
698
+ sensor does not support it or because there is a transient issue when
699
+ retrieving the metric from the sensor.
700
+
701
+ The supported metrics by a sensor can even change with time, for example,
702
+ if a sensor is updated with new firmware.
703
+
704
+ Args:
705
+ sensor: The sensor to stream data from.
706
+ metrics: List of metrics to return. Only the specified metrics will be
707
+ returned.
708
+ buffer_size: The maximum number of messages to buffer in the returned
709
+ receiver. After this limit is reached, the oldest messages will be
710
+ dropped.
711
+
712
+ Returns:
713
+ The telemetry stream from the sensor.
714
+ """
715
+ sensor_id = _get_sensor_id(sensor)
716
+ metrics_set = frozenset([_get_metric_value(m) for m in metrics])
717
+ key = f"{sensor_id}-{hash(metrics_set)}"
718
+ broadcaster = self._sensor_data_broadcasters.get(key)
719
+ if broadcaster is None:
720
+ client_id = hex(id(self))[2:]
721
+ stream_name = f"microgrid-client-{client_id}-sensor-data-{key}"
722
+ # Alias to avoid too long lines linter errors
723
+ # pylint: disable-next=invalid-name
724
+ Request = microgrid_pb2.ReceiveSensorTelemetryStreamRequest
725
+ broadcaster = streaming.GrpcStreamBroadcaster(
726
+ stream_name,
727
+ lambda: aiter(
728
+ self.stub.ReceiveSensorTelemetryStream(
729
+ Request(
730
+ sensor_id=sensor_id,
731
+ filter=Request.SensorTelemetryStreamFilter(
732
+ metrics=metrics_set
733
+ ),
734
+ ),
735
+ )
736
+ ),
737
+ lambda msg: sensor_telemetry_from_proto(msg.telemetry),
738
+ retry_strategy=self._retry_strategy,
739
+ )
740
+ self._sensor_data_broadcasters[key] = broadcaster
741
+ return broadcaster.new_receiver(maxsize=buffer_size)
742
+
635
743
 
636
744
  # pylint: disable-next=fixme
637
745
  # TODO: Remove this enum, now AugmentElectricalComponentBounds takes a simple timeout as
@@ -663,6 +771,17 @@ def _get_component_id(component: ComponentId | Component) -> int:
663
771
  assert_never(unexpected)
664
772
 
665
773
 
774
+ def _get_sensor_id(sensor: SensorId | Sensor) -> int:
775
+ """Get the sensor ID from a sensor or sensor ID."""
776
+ match sensor:
777
+ case SensorId():
778
+ return int(sensor)
779
+ case Sensor():
780
+ return int(sensor.id)
781
+ case unexpected:
782
+ assert_never(unexpected)
783
+
784
+
666
785
  def _get_metric_value(metric: Metric | int) -> metrics_pb2.Metric.ValueType:
667
786
  """Get the metric ID from a metric or metric ID."""
668
787
  match metric:
@@ -3,7 +3,6 @@
3
3
 
4
4
  """Lifetime of a microgrid asset."""
5
5
 
6
-
7
6
  from dataclasses import dataclass
8
7
  from datetime import datetime, timezone
9
8
 
@@ -3,7 +3,6 @@
3
3
 
4
4
  """Location information for a microgrid."""
5
5
 
6
-
7
6
  from dataclasses import dataclass
8
7
 
9
8
 
@@ -3,7 +3,6 @@
3
3
 
4
4
  """Loading of MicrogridInfo objects from protobuf messages."""
5
5
 
6
-
7
6
  import logging
8
7
 
9
8
  from frequenz.api.common.v1alpha8.microgrid import microgrid_pb2
@@ -51,6 +51,7 @@ from ._problematic import (
51
51
  )
52
52
  from ._relay import Relay
53
53
  from ._state_sample import ComponentErrorCode, ComponentStateCode, ComponentStateSample
54
+ from ._steam_boiler import SteamBoiler
54
55
  from ._types import (
55
56
  ComponentTypes,
56
57
  ProblematicComponentTypes,
@@ -97,6 +98,7 @@ __all__ = [
97
98
  "ProblematicComponentTypes",
98
99
  "Relay",
99
100
  "SolarInverter",
101
+ "SteamBoiler",
100
102
  "UnrecognizedBattery",
101
103
  "UnrecognizedComponent",
102
104
  "UnrecognizedComponentTypes",
@@ -107,3 +107,6 @@ class ComponentCategory(enum.Enum):
107
107
 
108
108
  WIND_TURBINE = electrical_components_pb2.ELECTRICAL_COMPONENT_CATEGORY_WIND_TURBINE
109
109
  """A wind turbine."""
110
+
111
+ STEAM_BOILER = electrical_components_pb2.ELECTRICAL_COMPONENT_CATEGORY_STEAM_BOILER
112
+ """A steam boiler."""
@@ -58,6 +58,7 @@ from ._problematic import (
58
58
  UnspecifiedComponent,
59
59
  )
60
60
  from ._relay import Relay
61
+ from ._steam_boiler import SteamBoiler
61
62
  from ._types import ComponentTypes
62
63
  from ._voltage_transformer import VoltageTransformer
63
64
  from ._wind_turbine import WindTurbine
@@ -256,6 +257,7 @@ def component_from_proto_with_issues(
256
257
  | ComponentCategory.METER
257
258
  | ComponentCategory.PRECHARGER
258
259
  | ComponentCategory.RELAY
260
+ | ComponentCategory.STEAM_BOILER
259
261
  | ComponentCategory.WIND_TURBINE
260
262
  ):
261
263
  return _trivial_category_to_class(base_data.category)(
@@ -451,6 +453,7 @@ def _trivial_category_to_class(
451
453
  | Meter
452
454
  | Precharger
453
455
  | Relay
456
+ | SteamBoiler
454
457
  | WindTurbine
455
458
  ]:
456
459
  """Return the class corresponding to a trivial component category."""
@@ -464,6 +467,7 @@ def _trivial_category_to_class(
464
467
  ComponentCategory.METER: Meter,
465
468
  ComponentCategory.PRECHARGER: Precharger,
466
469
  ComponentCategory.RELAY: Relay,
470
+ ComponentCategory.STEAM_BOILER: SteamBoiler,
467
471
  ComponentCategory.WIND_TURBINE: WindTurbine,
468
472
  }[category]
469
473
 
@@ -3,7 +3,6 @@
3
3
 
4
4
  """Loading of ComponentDataSamples objects from protobuf messages."""
5
5
 
6
-
7
6
  import logging
8
7
  from functools import partial
9
8
 
@@ -0,0 +1,18 @@
1
+ # License: MIT
2
+ # Copyright © 2026 Frequenz Energy-as-a-Service GmbH
3
+
4
+ """Steam boiler component."""
5
+
6
+ import dataclasses
7
+ from typing import Literal
8
+
9
+ from ._category import ComponentCategory
10
+ from ._component import Component
11
+
12
+
13
+ @dataclasses.dataclass(frozen=True, kw_only=True)
14
+ class SteamBoiler(Component):
15
+ """A steam boiler component."""
16
+
17
+ category: Literal[ComponentCategory.STEAM_BOILER] = ComponentCategory.STEAM_BOILER
18
+ """The category of this component."""
@@ -22,6 +22,7 @@ from ._problematic import (
22
22
  UnspecifiedComponent,
23
23
  )
24
24
  from ._relay import Relay
25
+ from ._steam_boiler import SteamBoiler
25
26
  from ._voltage_transformer import VoltageTransformer
26
27
  from ._wind_turbine import WindTurbine
27
28
 
@@ -59,6 +60,7 @@ ComponentTypes: TypeAlias = (
59
60
  | Precharger
60
61
  | ProblematicComponentTypes
61
62
  | Relay
63
+ | SteamBoiler
62
64
  | VoltageTransformer
63
65
  | WindTurbine
64
66
  )
@@ -3,7 +3,6 @@
3
3
 
4
4
  """Loading of Bounds objects from protobuf messages."""
5
5
 
6
-
7
6
  from frequenz.api.common.v1alpha8.metrics import bounds_pb2
8
7
 
9
8
  from ._bounds import Bounds
@@ -3,7 +3,6 @@
3
3
 
4
4
  """Supported metrics for microgrid components."""
5
5
 
6
-
7
6
  from frequenz.api.common.v1alpha8.metrics import metrics_pb2
8
7
  from frequenz.core import enum
9
8
 
@@ -0,0 +1,48 @@
1
+ # License: MIT
2
+ # Copyright © 2025 Frequenz Energy-as-a-Service GmbH
3
+
4
+ """Microgrid sensors.
5
+
6
+ This package provides classes and utilities for working with different types of
7
+ sensors in a microgrid environment. [`Sensor`][frequenz.client.microgrid.sensor.Sensor]s
8
+ measure various physical metrics in the surrounding environment, such as temperature,
9
+ humidity, and solar irradiance.
10
+
11
+ # Sensor Telemetry
12
+
13
+ This package also provides several data structures for handling sensor readings
14
+ and states:
15
+
16
+ * [`SensorTelemetry`][frequenz.client.microgrid.sensor.SensorTelemetry]:
17
+ Represents a collection of measurements and states from a sensor at a specific
18
+ point in time, including [metric
19
+ samples][frequenz.client.microgrid.metrics.MetricSample] and [state
20
+ snapshots][frequenz.client.microgrid.sensor.SensorStateSnapshot].
21
+ * [`SensorStateSnapshot`][frequenz.client.microgrid.sensor.SensorStateSnapshot]:
22
+ Contains the sensor's state codes and any associated diagnostic information.
23
+ * [`SensorDiagnostic`][frequenz.client.microgrid.sensor.SensorDiagnostic]:
24
+ Represents a diagnostic message from a sensor, including an error code and
25
+ optional additional information.
26
+ * [`SensorDiagnosticCode`][frequenz.client.microgrid.sensor.SensorDiagnosticCode]:
27
+ Defines error codes that a sensor can report.
28
+ * [`SensorStateCode`][frequenz.client.microgrid.sensor.SensorStateCode]:
29
+ Defines codes representing the operational state of a sensor.
30
+ """
31
+
32
+ from ._sensor import Sensor
33
+ from ._state import (
34
+ SensorDiagnostic,
35
+ SensorDiagnosticCode,
36
+ SensorStateCode,
37
+ SensorStateSnapshot,
38
+ )
39
+ from ._telemetry import SensorTelemetry
40
+
41
+ __all__ = [
42
+ "Sensor",
43
+ "SensorDiagnostic",
44
+ "SensorDiagnosticCode",
45
+ "SensorStateCode",
46
+ "SensorStateSnapshot",
47
+ "SensorTelemetry",
48
+ ]