aiosolaredge 0.1.0__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.
@@ -0,0 +1,22 @@
1
+
2
+ MIT License
3
+
4
+ Copyright (c) 2024 J. Nick Koston
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
@@ -0,0 +1,95 @@
1
+ Metadata-Version: 2.1
2
+ Name: aiosolaredge
3
+ Version: 0.1.0
4
+ Summary: Asyncio SolarEdge
5
+ Home-page: https://github.com/bdraco/aiosolaredge
6
+ License: MIT
7
+ Author: J. Nick Koston
8
+ Author-email: nick@koston.org
9
+ Requires-Python: >=3.10,<4.0
10
+ Classifier: Development Status :: 2 - Pre-Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Natural Language :: English
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Software Development :: Libraries
20
+ Requires-Dist: aiohttp (>=3.9.0)
21
+ Requires-Dist: yarl (>=1.9.0)
22
+ Project-URL: Bug Tracker, https://github.com/bdraco/aiosolaredge/issues
23
+ Project-URL: Changelog, https://github.com/bdraco/aiosolaredge/blob/main/CHANGELOG.md
24
+ Project-URL: Documentation, https://aiosolaredge.readthedocs.io
25
+ Project-URL: Repository, https://github.com/bdraco/aiosolaredge
26
+ Description-Content-Type: text/markdown
27
+
28
+ # Asyncio SolarEdge
29
+
30
+ <p align="center">
31
+ <a href="https://github.com/bdraco/aiosolaredge/actions/workflows/ci.yml?query=branch%3Amain">
32
+ <img src="https://img.shields.io/github/actions/workflow/status/bdraco/aiosolaredge/ci.yml?branch=main&label=CI&logo=github&style=flat-square" alt="CI Status" >
33
+ </a>
34
+ <a href="https://aiosolaredge.readthedocs.io">
35
+ <img src="https://img.shields.io/readthedocs/aiosolaredge.svg?logo=read-the-docs&logoColor=fff&style=flat-square" alt="Documentation Status">
36
+ </a>
37
+ <a href="https://codecov.io/gh/bdraco/aiosolaredge">
38
+ <img src="https://img.shields.io/codecov/c/github/bdraco/aiosolaredge.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage">
39
+ </a>
40
+ </p>
41
+ <p align="center">
42
+ <a href="https://python-poetry.org/">
43
+ <img src="https://img.shields.io/badge/packaging-poetry-299bd7?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAASCAYAAABrXO8xAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJJSURBVHgBfZLPa1NBEMe/s7tNXoxW1KJQKaUHkXhQvHgW6UHQQ09CBS/6V3hKc/AP8CqCrUcpmop3Cx48eDB4yEECjVQrlZb80CRN8t6OM/teagVxYZi38+Yz853dJbzoMV3MM8cJUcLMSUKIE8AzQ2PieZzFxEJOHMOgMQQ+dUgSAckNXhapU/NMhDSWLs1B24A8sO1xrN4NECkcAC9ASkiIJc6k5TRiUDPhnyMMdhKc+Zx19l6SgyeW76BEONY9exVQMzKExGKwwPsCzza7KGSSWRWEQhyEaDXp6ZHEr416ygbiKYOd7TEWvvcQIeusHYMJGhTwF9y7sGnSwaWyFAiyoxzqW0PM/RjghPxF2pWReAowTEXnDh0xgcLs8l2YQmOrj3N7ByiqEoH0cARs4u78WgAVkoEDIDoOi3AkcLOHU60RIg5wC4ZuTC7FaHKQm8Hq1fQuSOBvX/sodmNJSB5geaF5CPIkUeecdMxieoRO5jz9bheL6/tXjrwCyX/UYBUcjCaWHljx1xiX6z9xEjkYAzbGVnB8pvLmyXm9ep+W8CmsSHQQY77Zx1zboxAV0w7ybMhQmfqdmmw3nEp1I0Z+FGO6M8LZdoyZnuzzBdjISicKRnpxzI9fPb+0oYXsNdyi+d3h9bm9MWYHFtPeIZfLwzmFDKy1ai3p+PDls1Llz4yyFpferxjnyjJDSEy9CaCx5m2cJPerq6Xm34eTrZt3PqxYO1XOwDYZrFlH1fWnpU38Y9HRze3lj0vOujZcXKuuXm3jP+s3KbZVra7y2EAAAAAASUVORK5CYII=" alt="Poetry">
44
+ </a>
45
+ <a href="https://github.com/ambv/black">
46
+ <img src="https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square" alt="black">
47
+ </a>
48
+ <a href="https://github.com/pre-commit/pre-commit">
49
+ <img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square" alt="pre-commit">
50
+ </a>
51
+ </p>
52
+ <p align="center">
53
+ <a href="https://pypi.org/project/aiosolaredge/">
54
+ <img src="https://img.shields.io/pypi/v/aiosolaredge.svg?logo=python&logoColor=fff&style=flat-square" alt="PyPI Version">
55
+ </a>
56
+ <img src="https://img.shields.io/pypi/pyversions/aiosolaredge.svg?style=flat-square&logo=python&amp;logoColor=fff" alt="Supported Python versions">
57
+ <img src="https://img.shields.io/pypi/l/aiosolaredge.svg?style=flat-square" alt="License">
58
+ </p>
59
+
60
+ ---
61
+
62
+ **Documentation**: <a href="https://aiosolaredge.readthedocs.io" target="_blank">https://aiosolaredge.readthedocs.io </a>
63
+
64
+ **Source Code**: <a href="https://github.com/bdraco/aiosolaredge" target="_blank">https://github.com/bdraco/aiosolaredge </a>
65
+
66
+ ---
67
+
68
+ Asyncio SolarEdge
69
+
70
+ ## Installation
71
+
72
+ Install this via pip (or your favourite package manager):
73
+
74
+ `pip install aiosolaredge`
75
+
76
+ ## Contributors ✨
77
+
78
+ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
79
+
80
+ <!-- prettier-ignore-start -->
81
+ <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
82
+ <!-- markdownlint-disable -->
83
+ <!-- markdownlint-enable -->
84
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
85
+ <!-- prettier-ignore-end -->
86
+
87
+ This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
88
+
89
+ ## Credits
90
+
91
+ This package was created with
92
+ [Copier](https://copier.readthedocs.io/) and the
93
+ [browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template)
94
+ project template.
95
+
@@ -0,0 +1,67 @@
1
+ # Asyncio SolarEdge
2
+
3
+ <p align="center">
4
+ <a href="https://github.com/bdraco/aiosolaredge/actions/workflows/ci.yml?query=branch%3Amain">
5
+ <img src="https://img.shields.io/github/actions/workflow/status/bdraco/aiosolaredge/ci.yml?branch=main&label=CI&logo=github&style=flat-square" alt="CI Status" >
6
+ </a>
7
+ <a href="https://aiosolaredge.readthedocs.io">
8
+ <img src="https://img.shields.io/readthedocs/aiosolaredge.svg?logo=read-the-docs&logoColor=fff&style=flat-square" alt="Documentation Status">
9
+ </a>
10
+ <a href="https://codecov.io/gh/bdraco/aiosolaredge">
11
+ <img src="https://img.shields.io/codecov/c/github/bdraco/aiosolaredge.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage">
12
+ </a>
13
+ </p>
14
+ <p align="center">
15
+ <a href="https://python-poetry.org/">
16
+ <img src="https://img.shields.io/badge/packaging-poetry-299bd7?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAASCAYAAABrXO8xAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJJSURBVHgBfZLPa1NBEMe/s7tNXoxW1KJQKaUHkXhQvHgW6UHQQ09CBS/6V3hKc/AP8CqCrUcpmop3Cx48eDB4yEECjVQrlZb80CRN8t6OM/teagVxYZi38+Yz853dJbzoMV3MM8cJUcLMSUKIE8AzQ2PieZzFxEJOHMOgMQQ+dUgSAckNXhapU/NMhDSWLs1B24A8sO1xrN4NECkcAC9ASkiIJc6k5TRiUDPhnyMMdhKc+Zx19l6SgyeW76BEONY9exVQMzKExGKwwPsCzza7KGSSWRWEQhyEaDXp6ZHEr416ygbiKYOd7TEWvvcQIeusHYMJGhTwF9y7sGnSwaWyFAiyoxzqW0PM/RjghPxF2pWReAowTEXnDh0xgcLs8l2YQmOrj3N7ByiqEoH0cARs4u78WgAVkoEDIDoOi3AkcLOHU60RIg5wC4ZuTC7FaHKQm8Hq1fQuSOBvX/sodmNJSB5geaF5CPIkUeecdMxieoRO5jz9bheL6/tXjrwCyX/UYBUcjCaWHljx1xiX6z9xEjkYAzbGVnB8pvLmyXm9ep+W8CmsSHQQY77Zx1zboxAV0w7ybMhQmfqdmmw3nEp1I0Z+FGO6M8LZdoyZnuzzBdjISicKRnpxzI9fPb+0oYXsNdyi+d3h9bm9MWYHFtPeIZfLwzmFDKy1ai3p+PDls1Llz4yyFpferxjnyjJDSEy9CaCx5m2cJPerq6Xm34eTrZt3PqxYO1XOwDYZrFlH1fWnpU38Y9HRze3lj0vOujZcXKuuXm3jP+s3KbZVra7y2EAAAAAASUVORK5CYII=" alt="Poetry">
17
+ </a>
18
+ <a href="https://github.com/ambv/black">
19
+ <img src="https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square" alt="black">
20
+ </a>
21
+ <a href="https://github.com/pre-commit/pre-commit">
22
+ <img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square" alt="pre-commit">
23
+ </a>
24
+ </p>
25
+ <p align="center">
26
+ <a href="https://pypi.org/project/aiosolaredge/">
27
+ <img src="https://img.shields.io/pypi/v/aiosolaredge.svg?logo=python&logoColor=fff&style=flat-square" alt="PyPI Version">
28
+ </a>
29
+ <img src="https://img.shields.io/pypi/pyversions/aiosolaredge.svg?style=flat-square&logo=python&amp;logoColor=fff" alt="Supported Python versions">
30
+ <img src="https://img.shields.io/pypi/l/aiosolaredge.svg?style=flat-square" alt="License">
31
+ </p>
32
+
33
+ ---
34
+
35
+ **Documentation**: <a href="https://aiosolaredge.readthedocs.io" target="_blank">https://aiosolaredge.readthedocs.io </a>
36
+
37
+ **Source Code**: <a href="https://github.com/bdraco/aiosolaredge" target="_blank">https://github.com/bdraco/aiosolaredge </a>
38
+
39
+ ---
40
+
41
+ Asyncio SolarEdge
42
+
43
+ ## Installation
44
+
45
+ Install this via pip (or your favourite package manager):
46
+
47
+ `pip install aiosolaredge`
48
+
49
+ ## Contributors ✨
50
+
51
+ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
52
+
53
+ <!-- prettier-ignore-start -->
54
+ <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
55
+ <!-- markdownlint-disable -->
56
+ <!-- markdownlint-enable -->
57
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
58
+ <!-- prettier-ignore-end -->
59
+
60
+ This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
61
+
62
+ ## Credits
63
+
64
+ This package was created with
65
+ [Copier](https://copier.readthedocs.io/) and the
66
+ [browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template)
67
+ project template.
@@ -0,0 +1,149 @@
1
+ [tool.poetry]
2
+ name = "aiosolaredge"
3
+ version = "0.1.0"
4
+ description = "Asyncio SolarEdge"
5
+ authors = ["J. Nick Koston <nick@koston.org>"]
6
+ license = "MIT"
7
+ readme = "README.md"
8
+ repository = "https://github.com/bdraco/aiosolaredge"
9
+ documentation = "https://aiosolaredge.readthedocs.io"
10
+ classifiers = [
11
+ "Development Status :: 2 - Pre-Alpha",
12
+ "Intended Audience :: Developers",
13
+ "Natural Language :: English",
14
+ "Operating System :: OS Independent",
15
+ "Topic :: Software Development :: Libraries",
16
+ ]
17
+ packages = [
18
+ { include = "aiosolaredge", from = "src" },
19
+ ]
20
+
21
+ [tool.poetry.urls]
22
+ "Bug Tracker" = "https://github.com/bdraco/aiosolaredge/issues"
23
+ "Changelog" = "https://github.com/bdraco/aiosolaredge/blob/main/CHANGELOG.md"
24
+
25
+ [tool.poetry.dependencies]
26
+ python = "^3.10"
27
+ aiohttp = ">=3.9.0"
28
+ yarl = ">=1.9.0"
29
+
30
+ [tool.poetry.group.dev.dependencies]
31
+ pytest = "^7.0"
32
+ pytest-cov = "^3.0"
33
+ pytest-asyncio = "^0.23.6"
34
+
35
+ [tool.poetry.group.docs]
36
+ optional = true
37
+
38
+ [tool.poetry.group.docs.dependencies]
39
+ myst-parser = { version = ">=0.16", python = ">=3.11"}
40
+ sphinx = { version = ">=4.0", python = ">=3.11"}
41
+ furo = { version = ">=2023.5.20", python = ">=3.11"}
42
+ sphinx-autobuild = { version = ">=2024.0.0", python = ">=3.11"}
43
+
44
+ [tool.semantic_release]
45
+ version_toml = ["pyproject.toml:tool.poetry.version"]
46
+ version_variables = [
47
+ "src/aiosolaredge/__init__.py:__version__",
48
+ "docs/conf.py:release",
49
+ ]
50
+ build_command = "pip install poetry && poetry build"
51
+
52
+ [tool.semantic_release.changelog]
53
+ exclude_commit_patterns = [
54
+ "chore*",
55
+ "ci*",
56
+ ]
57
+
58
+ [tool.semantic_release.changelog.environment]
59
+ keep_trailing_newline = true
60
+
61
+ [tool.semantic_release.branches.main]
62
+ match = "main"
63
+
64
+ [tool.semantic_release.branches.noop]
65
+ match = "(?!main$)"
66
+ prerelease = true
67
+
68
+ [tool.pytest.ini_options]
69
+ addopts = "-v -Wdefault --cov=aiosolaredge --cov-report=term-missing:skip-covered"
70
+ pythonpath = ["src"]
71
+
72
+ [tool.coverage.run]
73
+ branch = true
74
+
75
+ [tool.coverage.report]
76
+ exclude_lines = [
77
+ "pragma: no cover",
78
+ "@overload",
79
+ "if TYPE_CHECKING",
80
+ "raise NotImplementedError",
81
+ 'if __name__ == "__main__":',
82
+ ]
83
+
84
+ [tool.ruff]
85
+ target-version = "py38"
86
+ line-length = 88
87
+ ignore = [
88
+ "D203", # 1 blank line required before class docstring
89
+ "D212", # Multi-line docstring summary should start at the first line
90
+ "D100", # Missing docstring in public module
91
+ "D104", # Missing docstring in public package
92
+ "D107", # Missing docstring in `__init__`
93
+ "D401", # First line of docstring should be in imperative mood
94
+ ]
95
+ select = [
96
+ "B", # flake8-bugbear
97
+ "D", # flake8-docstrings
98
+ "C4", # flake8-comprehensions
99
+ "S", # flake8-bandit
100
+ "F", # pyflake
101
+ "E", # pycodestyle
102
+ "W", # pycodestyle
103
+ "UP", # pyupgrade
104
+ "I", # isort
105
+ "RUF", # ruff specific
106
+ ]
107
+
108
+ [tool.ruff.per-file-ignores]
109
+ "tests/**/*" = [
110
+ "D100",
111
+ "D101",
112
+ "D102",
113
+ "D103",
114
+ "D104",
115
+ "S101",
116
+ ]
117
+ "setup.py" = ["D100"]
118
+ "conftest.py" = ["D100"]
119
+ "docs/conf.py" = ["D100"]
120
+
121
+ [tool.ruff.isort]
122
+ known-first-party = ["aiosolaredge", "tests"]
123
+
124
+ [tool.mypy]
125
+ check_untyped_defs = true
126
+ disallow_any_generics = true
127
+ disallow_incomplete_defs = true
128
+ disallow_untyped_defs = true
129
+ mypy_path = "src/"
130
+ no_implicit_optional = true
131
+ show_error_codes = true
132
+ warn_unreachable = true
133
+ warn_unused_ignores = true
134
+ exclude = [
135
+ 'docs/.*',
136
+ 'setup.py',
137
+ ]
138
+
139
+ [[tool.mypy.overrides]]
140
+ module = "tests.*"
141
+ allow_untyped_defs = true
142
+
143
+ [[tool.mypy.overrides]]
144
+ module = "docs.*"
145
+ ignore_errors = true
146
+
147
+ [build-system]
148
+ requires = ["poetry-core>=1.0.0"]
149
+ build-backend = "poetry.core.masonry.api"
@@ -0,0 +1,7 @@
1
+ from __future__ import annotations
2
+
3
+ __version__ = "0.1.0"
4
+
5
+ from .solaredge import SolarEdge
6
+
7
+ __all__ = ["SolarEdge"]
File without changes
@@ -0,0 +1,117 @@
1
+ from datetime import datetime
2
+ from typing import Any, Iterable, Literal, Optional
3
+
4
+ import aiohttp
5
+ import yarl
6
+
7
+ _BASE_URL = yarl.URL("https://monitoringapi.solaredge.com")
8
+ _DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S"
9
+
10
+
11
+ class SolarEdge:
12
+ """SolarEdge API client."""
13
+
14
+ def __init__(
15
+ self,
16
+ api_key: str,
17
+ session: Optional[aiohttp.ClientSession] = None,
18
+ timeout: int = 10,
19
+ ) -> None:
20
+ """Initialize the SolarEdge API client."""
21
+ self.api_key = api_key
22
+ self.session = session or aiohttp.ClientSession()
23
+ self._created_session = not session
24
+ self.timeout = timeout
25
+
26
+ async def close(self) -> None:
27
+ """Close the SolarEdge API client."""
28
+ if self._created_session:
29
+ await self.session.close()
30
+
31
+ def _get_site_url(self, site_id: int) -> yarl.URL:
32
+ """Get the site URL."""
33
+ return _BASE_URL.joinpath("site", str(site_id))
34
+
35
+ async def get_details(self, site_id: int) -> dict[str, Any]:
36
+ """
37
+ Get details of the SolarEdge system.
38
+
39
+ :param site_id: The site ID.
40
+ :return: The details of the SolarEdge system.
41
+ """
42
+ return await self._get_json(self._get_site_url(site_id).joinpath("details"))
43
+
44
+ async def get_overview(self, site_id: int) -> dict[str, Any]:
45
+ """
46
+ Get overview of the SolarEdge system.
47
+
48
+ :param site_id: The site ID.
49
+ :return: The overview of the SolarEdge system.
50
+ """
51
+ return await self._get_json(self._get_site_url(site_id).joinpath("overview"))
52
+
53
+ async def get_inventory(self, site_id: int) -> dict[str, Any]:
54
+ """
55
+ Get inventory of the SolarEdge system.
56
+
57
+ :param site_id: The site ID.
58
+ :return: The inventory of the SolarEdge system.
59
+ """
60
+ return await self._get_json(self._get_site_url(site_id).joinpath("inventory"))
61
+
62
+ async def get_energy_details(
63
+ self,
64
+ site_id: int,
65
+ start_time: datetime,
66
+ end_time: datetime,
67
+ meters: Iterable[
68
+ Literal[
69
+ "PRODUCTION", "CONSUMPTION", "SELFCONSUMPTION", "FEEDIN", "PURCHASED"
70
+ ]
71
+ ] = [],
72
+ time_unit: str = "DAY",
73
+ ) -> dict[str, Any]:
74
+ """
75
+ Get energy details of the SolarEdge system.
76
+
77
+ :param site_id: The site ID.
78
+ :param start_time: The start time.
79
+ :param end_time: The end time.
80
+ :param meters: The meters.
81
+ an iterable of PRODUCTION,CONSUMPTION,SELFCONSUMPTION,FEEDIN,PURCHASED
82
+ :param time_unit: The time unit.
83
+ one of "QUARTER_OF_AN_HOUR", "HOUR", "DAY", "WEEK", "MONTH", "YEAR"
84
+ :return: The energy details of the SolarEdge system.
85
+ """
86
+ url = self._get_site_url(site_id).joinpath("energyDetails")
87
+ params = {
88
+ "startTime": start_time.strftime(_DATETIME_FORMAT),
89
+ "endTime": end_time.strftime(_DATETIME_FORMAT),
90
+ "timeUnit": time_unit,
91
+ }
92
+ if meters:
93
+ params["meters"] = ",".join(meters)
94
+ return await self._get_json(url, params=params)
95
+
96
+ async def get_current_power_flow(self, site_id: int) -> dict[str, Any]:
97
+ """
98
+ Get current power flow of the SolarEdge system.
99
+
100
+ :param site_id: The site ID.
101
+ :return: The current power flow of the SolarEdge system.
102
+ """
103
+ return await self._get_json(
104
+ self._get_site_url(site_id).joinpath("currentPowerFlow")
105
+ )
106
+
107
+ async def _get_json(
108
+ self, url: yarl.URL, params: dict[str, Any] | None = None
109
+ ) -> dict[str, Any]:
110
+ """Get JSON from the SolarEdge API."""
111
+ response = await self.session.get(
112
+ url,
113
+ params={"api_key": self.api_key, **(params or {})},
114
+ timeout=self.timeout,
115
+ )
116
+ response.raise_for_status()
117
+ return await response.json()