You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add support for multiple solar planes (#171)
Add the ability to specify multiple planes for solar panel configurations.
- Add new Plane dataclass with declination, azimuth, and kwp fields
- Add planes parameter to ForecastSolar class
- Build multi-plane URL paths for estimate and validate_plane methods
- Silently ignore additional planes when no API key is provided
- Update README with documentation and usage examples
- Add comprehensive tests for multi-plane functionality
Co-authored-by: Junie <noreply@jb.gg>
* Fix linter errors in test_models.py
- Remove unused snapshot parameter from test_planes_ignored_without_api_key
- Split long comment to comply with line length limit
* Add linting section to README.md
- Add recommendation to run ruff linter before committing
- Include commands for checking and auto-fixing linting issues
* Revert "Add linting section to README.md"
This reverts commit 685cc7d.
* Add example file demonstrating multiple planes functionality
Co-authored-by: Junie <noreply@jb.gg>
* Update examples/planes.py
Co-authored-by: Klaas Schoute <klaas_schoute@hotmail.com>
* docs: clarify subscription requirements for multiple planes and actual parameter
Co-authored-by: Junie <noreply@jb.gg>
* fix: handle 404 errors in API requests
Explicitly handle HTTP 404 status codes in _request method and raise ForecastSolarRequestError. Added tests to verify the behavior.
Co-authored-by: Junie <junie@jetbrains.com>
---------
Co-authored-by: Junie <noreply@jb.gg>
Co-authored-by: Klaas Schoute <klaas_schoute@hotmail.com>
Co-authored-by: Junie <junie@jetbrains.com>
Copy file name to clipboardExpand all lines: README.md
+54-8Lines changed: 54 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,23 +85,68 @@ async def main() -> None:
85
85
print(estimate)
86
86
87
87
88
+
if__name__=="__main__":
89
+
asyncio.run(main())
90
+
```
91
+
92
+
### Multiple Planes
93
+
94
+
If you have solar panels facing different directions, you can specify multiple planes.
95
+
96
+
**Note:** Using multiple planes requires both an API key and a Personal Plus (or higher) subscription. If no API key is provided, additional planes will be silently ignored. See the [subscription plan overview][forecast-subscription] for more information.
97
+
98
+
```python
99
+
import asyncio
100
+
101
+
from forecast_solar import ForecastSolar, Plane
102
+
103
+
104
+
asyncdefmain() -> None:
105
+
"""Show example with multiple planes."""
106
+
asyncwith ForecastSolar(
107
+
api_key="YOUR_API_KEY",
108
+
latitude=52.16,
109
+
longitude=4.47,
110
+
# First plane (primary)
111
+
declination=20,
112
+
azimuth=10,
113
+
kwp=2.160,
114
+
# Additional planes
115
+
planes=[
116
+
Plane(declination=30, azimuth=-90, kwp=1.5), # Second plane
117
+
Plane(declination=25, azimuth=90, kwp=1.0), # Third plane
0 commit comments