-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
40cacec
commit d9642c4
Showing
25 changed files
with
4,930 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
name: HACS Validation | ||
|
||
on: | ||
pull_request: | ||
push: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
hacs: | ||
name: HACS Validation | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: ⤵️ Check out code from GitHub | ||
uses: actions/[email protected] | ||
|
||
- name: 🚀 Run HACS validation | ||
uses: hacs/action@main | ||
with: | ||
category: integration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
name: Hassfest | ||
|
||
on: | ||
pull_request: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
hassfest: | ||
name: Hassfest | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: ⤵️ Check out code from GitHub | ||
uses: actions/[email protected] | ||
|
||
- name: 🚀 Run hassfest validation | ||
uses: home-assistant/actions/hassfest@master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
name: Pylint | ||
|
||
on: | ||
pull_request: | ||
push: | ||
workflow_dispatch: | ||
|
||
env: | ||
DEFAULT_PYTHON: "3.11" | ||
|
||
jobs: | ||
pylint: | ||
name: Pylint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: ⤵️ Check out code from GitHub | ||
uses: actions/[email protected] | ||
|
||
- name: 🏗 Set up Poetry | ||
run: pipx install poetry | ||
|
||
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
cache: "poetry" | ||
|
||
- name: 🏗 Install Python dependencies | ||
run: poetry install --no-interaction | ||
|
||
- name: 🚀 Run Pylint | ||
run: poetry run pylint custom_components/octopus_spain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
id-token: write | ||
steps: | ||
- name: ⤵️ Check out code from GitHub | ||
uses: actions/[email protected] | ||
|
||
- name: 🔢 Adjust version number | ||
shell: bash | ||
run: | | ||
version="${{ github.event.release.tag_name }}" | ||
version="${version,,}" | ||
version="${version#v}" | ||
yq e -P -o=json \ | ||
-i ".version = \"${version}\"" \ | ||
"${{ github.workspace }}/custom_components/octopus_spain/manifest.json" | ||
- name: 📦 Created zipped release package | ||
shell: bash | ||
run: | | ||
cd "${{ github.workspace }}/custom_components/octopus_spain" | ||
zip octopus_spain.zip -r ./ | ||
- name: 🔏 Sign release package | ||
uses: sigstore/[email protected] | ||
with: | ||
inputs: ${{ github.workspace }}/custom_components/octopus_spain/octopus_spain.zip | ||
|
||
- name: ⬆️ Upload zip to release | ||
uses: softprops/[email protected] | ||
with: | ||
files: ${{ github.workspace }}/custom_components/octopus_spain/octopus_spain.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
name: Ruff | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
env: | ||
DEFAULT_PYTHON: "3.11" | ||
|
||
jobs: | ||
ruff: | ||
name: Ruff | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: ⤵️ Check out code from GitHub | ||
uses: actions/[email protected] | ||
|
||
- name: 🏗 Set up Poetry | ||
run: pipx install poetry | ||
|
||
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
cache: "poetry" | ||
|
||
- name: 🏗 Install Python dependencies | ||
run: poetry install --no-interaction | ||
|
||
- name: 🚀 Run ruff linter | ||
run: poetry run ruff check --output-format=github . | ||
|
||
- name: 🚀 Run ruff formatter | ||
run: poetry run ruff format --check . |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
--- | ||
repos: | ||
- repo: local | ||
hooks: | ||
- id: ruff-check | ||
name: 🐶 Ruff Linter | ||
language: system | ||
types: [python] | ||
entry: poetry run ruff check --fix | ||
require_serial: true | ||
stages: [commit, push, manual] | ||
- id: ruff-format | ||
name: 🐶 Ruff Formatter | ||
language: system | ||
types: [python] | ||
entry: poetry run ruff format | ||
require_serial: true | ||
stages: [commit, push, manual] | ||
- id: check-json | ||
name: { Check JSON files | ||
language: system | ||
types: [json] | ||
entry: poetry run check-json | ||
- id: check-toml | ||
name: ✅ Check TOML files | ||
language: system | ||
types: [toml] | ||
entry: poetry run check-toml | ||
- id: check-yaml | ||
name: ✅ Check YAML files | ||
language: system | ||
types: [yaml] | ||
entry: poetry run check-yaml | ||
- id: check-merge-conflict | ||
name: 💥 Check for merge conflicts | ||
language: system | ||
types: [text] | ||
entry: poetry run check-merge-conflict | ||
- id: check-symlinks | ||
name: 🔗 Check for broken symlinks | ||
language: system | ||
types: [symlink] | ||
entry: poetry run check-symlinks | ||
- id: end-of-file-fixer | ||
name: ⮐ Fix End of Files | ||
language: system | ||
types: [text] | ||
entry: poetry run end-of-file-fixer | ||
stages: [commit, push, manual] | ||
- id: no-commit-to-branch | ||
name: 🛑 Don't commit to main branch | ||
language: system | ||
entry: poetry run no-commit-to-branch | ||
pass_filenames: false | ||
always_run: true | ||
args: | ||
- --branch=main | ||
- id: poetry | ||
name: 📜 Check pyproject with Poetry | ||
language: system | ||
entry: poetry check | ||
pass_filenames: false | ||
always_run: true | ||
- id: pylint | ||
name: 🌟 Starring code with pylint | ||
language: system | ||
types: [python] | ||
entry: poetry run pylint | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v2.7.1 | ||
hooks: | ||
- id: prettier | ||
name: 🎨 Format using prettier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
from .async_base_client import AsyncBaseClient | ||
from .base_model import BaseModel, Upload | ||
from .exceptions import ( | ||
GraphQLClientError, | ||
GraphQLClientGraphQLError, | ||
GraphQLClientGraphQLMultiError, | ||
GraphQLClientHttpError, | ||
GraphQLClientInvalidResponseError, | ||
) | ||
from .get_accounts import ( | ||
GetAccounts, | ||
GetAccountsViewer, | ||
GetAccountsViewerAccountsAccount, | ||
GetAccountsViewerAccountsAccountInterface, | ||
GetAccountsViewerAccountsAccountProperties, | ||
GetAccountsViewerAccountsAccountPropertiesElectricitySupplyPoints, | ||
GetAccountsViewerAccountsAccountPropertiesElectricitySupplyPointsActiveAgreement, | ||
GetAccountsViewerAccountsAccountPropertiesElectricitySupplyPointsActiveAgreementDetails, | ||
GetAccountsViewerAccountsAccountPropertiesElectricitySupplyPointsActiveAgreementProduct, | ||
GetAccountsViewerAccountsAccountPropertiesElectricitySupplyPointsActiveAgreementProductPrices, | ||
) | ||
from .login import Login, LoginObtainKrakenToken | ||
from .octopus_api import OctopusAPI | ||
|
||
__all__ = [ | ||
"AsyncBaseClient", | ||
"BaseModel", | ||
"GetAccounts", | ||
"GetAccountsViewer", | ||
"GetAccountsViewerAccountsAccount", | ||
"GetAccountsViewerAccountsAccountInterface", | ||
"GetAccountsViewerAccountsAccountProperties", | ||
"GetAccountsViewerAccountsAccountPropertiesElectricitySupplyPoints", | ||
"GetAccountsViewerAccountsAccountPropertiesElectricitySupplyPointsActiveAgreement", | ||
"GetAccountsViewerAccountsAccountPropertiesElectricitySupplyPointsActiveAgreementDetails", | ||
"GetAccountsViewerAccountsAccountPropertiesElectricitySupplyPointsActiveAgreementProduct", | ||
"GetAccountsViewerAccountsAccountPropertiesElectricitySupplyPointsActiveAgreementProductPrices", | ||
"GraphQLClientError", | ||
"GraphQLClientGraphQLError", | ||
"GraphQLClientGraphQLMultiError", | ||
"GraphQLClientHttpError", | ||
"GraphQLClientInvalidResponseError", | ||
"Login", | ||
"LoginObtainKrakenToken", | ||
"OctopusAPI", | ||
"Upload", | ||
] |
Oops, something went wrong.