diff --git a/.github/workflows/hassfest.yaml b/.github/workflows/hassfest.yaml new file mode 100644 index 0000000..07d1dda --- /dev/null +++ b/.github/workflows/hassfest.yaml @@ -0,0 +1,14 @@ +name: Validate with hassfest + +on: + push: + pull_request: + schedule: + - cron: "0 0 * * *" + +jobs: + validate: + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@v3" + - uses: home-assistant/actions/hassfest@master diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml new file mode 100644 index 0000000..c422ec3 --- /dev/null +++ b/.github/workflows/validate.yaml @@ -0,0 +1,18 @@ +name: Validate + +on: + push: + pull_request: + schedule: + - cron: "0 0 * * *" + workflow_dispatch: + +jobs: + validate-hacs: + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@v3" + - name: HACS validation + uses: "hacs/action@main" + with: + category: "integration" diff --git a/README.md b/README.md index a8a71b9..4063183 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,13 @@ # Solaredge Forecast integration -Solaredge Forecast integration for Home Assistant uses the python package "SolarEdge" https://pypi.org/project/solaredge/ - -The Solaredge Forecast integration will collect monthly averaged solar product from the start of the production of the site. -It will forecast the total produced energy in kWh for a period of time (max 1 year). +Home assistant component that forecasts the total solar energy generation for a specified time period by using the [solaredge library](https://pypi.org/project/solaredge/) ## How to install -1. Make sure you have [hacs](https://hacs.xyz/) installed +1. Make sure yo have [hacs](https://hacs.xyz/) installed 2. Add this repository as custom repository to hacs by going to hacs, integrations, click on the three dots in the upper right corner and click on custom repositories. 3. In the repository field, fill in the link to this repository (https://github.com/nelbs/solaredge-forcast) and for category, select `Integration`. Click on `Add` -4. Go back to hacs, integrations and add click on the blue button `Exlore and download repositories` in the bottom left corner, search for `Solaredge-Forecast` and install it +4. Go back to hacs, integrations and add click on the blue button `Exlore and download repositories` in the bottom left corner, search for `Solaredge Forecast` and install it 5. Reboot HA 6. In HA goto Config -> Integrations. Add the Solaredge-Forecast integration to HA. 7. In your lovelace dashboard, add a card with the Solaredge-Forecast entities. @@ -44,4 +41,4 @@ Day of the month for which the total energy will be predicted. **Endmonth of the forecast period** Month of the month for which the total energy will be predicted. If the enddate is after the current date the -current year is used for the enddate. If the enddate is before the current date the next year will be used. \ No newline at end of file +current year is used for the enddate. If the enddate is before the current date the next year will be used. diff --git a/custom_components/solaredge_forecast/manifest.json b/custom_components/solaredge_forecast/manifest.json index 1d4e70d..0f7306d 100644 --- a/custom_components/solaredge_forecast/manifest.json +++ b/custom_components/solaredge_forecast/manifest.json @@ -1,8 +1,8 @@ { "domain": "solaredge_forecast", "name": "Solaredge Forecast", - "config_flow": true, "codeowners": ["@nelbs"], + "config_flow": true, "dependencies": [], "documentation": "https://www.home-assistant.io/integrations/solaredge_forecast", "iot_class": "cloud_polling", @@ -10,4 +10,4 @@ "requirements": [], "version": "0.1.0" } - \ No newline at end of file + diff --git a/custom_components/solaredge_forecast/solaredgeforecast/__init__.py b/custom_components/solaredge_forecast/solaredgeforecast/__init__.py index 3e3dd77..70f0eab 100644 --- a/custom_components/solaredge_forecast/solaredgeforecast/__init__.py +++ b/custom_components/solaredge_forecast/solaredgeforecast/__init__.py @@ -21,7 +21,6 @@ def __init__(self, startdate, enddate, site_id, account_key): def get_solar_forecast(self): """Calculate solar energy forecast.""" - now = datetime.now() yesterday = now.date() - timedelta(days=1) today = now.date()