https://github.com/mawinkler/pyastroweatherio
Wrapper for the 7timer and met.no API designed to work with Home Assistant
https://github.com/mawinkler/pyastroweatherio
7timer astronomy forecast homeassistant homeassistant-integration uptonight
Last synced: over 1 year ago
JSON representation
Wrapper for the 7timer and met.no API designed to work with Home Assistant
- Host: GitHub
- URL: https://github.com/mawinkler/pyastroweatherio
- Owner: mawinkler
- License: mit
- Created: 2021-01-29T08:25:54.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-04-22T11:01:43.000Z (over 2 years ago)
- Last Synced: 2024-04-22T12:02:19.270Z (over 2 years ago)
- Topics: 7timer, astronomy, forecast, homeassistant, homeassistant-integration, uptonight
- Language: Python
- Homepage:
- Size: 157 KB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pyAstroWeatherIO
Wrapper for the ***MET Norway Weather***, ***7Timer***, and ***Open-Meteo*** RESTful APIs. Designed to work with Home Assistant and the custom [AstroWeather](https://github.com/mawinkler/astroweather) integration.
In addition to the weather data, some calculations for the astronomical twilight and Moon setting, rising and phase are implemented. They indicate the darkness you can expect the upcoming night.
A new addition is an experimental mode that attempts to approximate the calculation of the lifted index, seeing atmospheric transparency, and ground fog density.
## Functions
The module exposes the following function:
```python
astroweather = AstroWeather(
session,
latitude,
longitude,
elevation,
timezone_info,
cloudcover_weight,
cloudcover_high_weakening,
cloudcover_medium_weakening,
cloudcover_low_weakening,
fog_weight,
seeing_weight,
transparency_weight,
calm_weight,
uptonight_path,
experimental_features,
forecast_model="icon_seamless",
)
astroweather.get_location_data
astroweather.get_hourly_forecast
```
This will return a handle to the AstroWeather class and open the connection.
## Setup
```sh
pip3 install .
```
## Build
```sh
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt
python3 setup.py sdist
twine upload dist/*
```
## Test
```sh
python -m unittest -v tests/client.py
```