Skip to content

Commit

Permalink
Bumped pkg version, documents and pipelines updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramunas-OAG committed Jul 26, 2024
1 parent 656c801 commit a4d2bd4
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 75 deletions.
89 changes: 48 additions & 41 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,52 @@
{
"name": "Home Assistant Dev Container",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"customizations": {
"vscode": {
"settings": {
"python.pythonPath": "/usr/local/bin/python",
"python.selectInterpreter": "/usr/local/bin/python",
"terminal.integrated.shell.linux": "/bin/bash"
},
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-toolsai.jupyter",
"ms-python.black-formatter",
"ms-python.autopep8",
"ms-python.pylint",
"ms-vscode.remote-containers",
"charliermarsh.ruff",
"yzhang.markdown-all-in-one",
"kevinrose.vsc-python-indent",
"keesschollaart.vscode-home-assistant",
"donjayamanne.githistory",
"mhutchie.git-graph",
"mikoz.black-py"
]
}
},
"postCreateCommand": "pip install -r requirements.txt",
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
"remoteUser": "vscode",
"mounts": [
"source=${localWorkspaceFolder}/config,target=/config,type=bind",
"source=${localWorkspaceFolder}/custom_components,target=/config/custom_components,type=bind"
"name": "Home Assistant Dev Container",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"postCreateCommand": "python -m pip install -r requirements.txt",
"runArgs": [
"-e",
"GIT_EDTIOR='code --wait'"
],
"customizations": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-toolsai.jupyter",
"ms-python.black-formatter",
"ms-python.autopep8",
"ms-python.pylint",
"ms-vscode.remote-containers",
"charliermarsh.ruff",
"yzhang.markdown-all-in-one",
"kevinrose.vsc-python-indent",
"keesschollaart.vscode-home-assistant",
"donjayamanne.githistory",
"mhutchie.git-graph",
"mikoz.black-py"
],
"forwardPorts": [
8123
],
"remoteEnv": {
"TZ": "Europe/Vilnius"
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"python.pythonPath": "/usr/local/bin/python",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.formatting.provider": "black",
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true
}
},
"remoteUser": "vscode",
"mounts": [
"source=${localWorkspaceFolder}/config,target=/config,type=bind",
"source=${localWorkspaceFolder}/custom_components,target=/config/custom_components,type=bind"
],
"forwardPorts": [
8123
],
"remoteEnv": {
"TZ": "Europe/Vilnius"
}
}
12 changes: 6 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ jobs:
name: "Ruff"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout the repository"
- name: Checkout the repository
uses: "actions/checkout@v4.1.7"

- name: "Set up Python"
- name: Set up Python
uses: actions/setup-python@v5.1.1
with:
python-version: "3.12"
cache: "pip"

- name: "Install requirements"
run: python3 -m pip install -r requirements.txt
- name: Install requirements
run: python -m pip install -r requirements.txt

- name: "Run"
run: python3 -m ruff check .
- name: Run
run: python -m ruff check .
29 changes: 17 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: "Release"

on:
release:
types:
- "published"
types: [published]

permissions: {}

Expand All @@ -14,22 +13,28 @@ jobs:
permissions:
contents: write
steps:
- name: "Checkout the repository"
uses: "actions/checkout@v4.1.7"
- name: Checkout the repository
uses: actions/checkout@v4.1.7

- name: "Adjust version number"
shell: "bash"
- name: Extract version from release
id: get_version
run: |
yq -i -o json '.version="${{ github.event.release.tag_name }}"' \
VERSION=${GITHUB_REF#refs/tags/v}
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Adjust version number
shell: bash
run: |
yq -i -o json '.version="${{ env.VERSION }}"' \
"${{ github.workspace }}/custom_components/meteo_lt/manifest.json"
- name: "ZIP the integration directory"
shell: "bash"
- name: ZIP the integration directory
shell: bash
run: |
cd "${{ github.workspace }}/custom_components/meteo_lt"
zip meteo_lt.zip -r ./
zip meteo_lt-${{ env.VERSION }}.zip -r ./
- name: "Upload the ZIP file to the release"
- name: Upload the ZIP file to the release
uses: softprops/action-gh-release@v2.0.8
with:
files: ${{ github.workspace }}/custom_components/meteo_lt/meteo_lt.zip
files: ${{ github.workspace }}/custom_components/meteo_lt/meteo_lt-${{ env.VERSION }}.zip
26 changes: 13 additions & 13 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ on:
- "main"

jobs:
hassfest: # https://developers.home-assistant.io/blog/2020/04/16/hassfest
hassfest:
name: "Hassfest Validation"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout the repository"
uses: "actions/checkout@v4.1.7"
- name: Checkout the repository
uses: actions/checkout@v4.1.7

- name: "Run hassfest validation"
uses: "home-assistant/actions/hassfest@master"
- name: Run hassfest validation
uses: home-assistant/actions/hassfest@master

hacs: # https://github.com/hacs/action
name: "HACS Validation"
runs-on: "ubuntu-latest"
hacs:
name: HACS Validation
runs-on: ubuntu-latest
steps:
- name: "Checkout the repository"
uses: "actions/checkout@v4.1.7"
- name: Checkout the repository
uses: actions/checkout@v4.1.7

- name: "Run HACS validation"
uses: "hacs/action@main"
- name: Run HACS validation
uses: hacs/action@main
with:
category: "integration"
category: integration
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ Platform | Description

Implementation has been done using Home Assistant version **2024.7.3**. Older versions could work too as long as the new Weather entity forecast types exist. Integration does **not** create Forecast Attributes.

>**NOTE:** At the moment of writing this - api.meteo.lt data renewal happens every 3 hours.
## Installation through HACS (Recommended Method)

This Integration is part of the default HACS store. Search for *Meteo.lt* under Integrations and install from there. After the installation of the files, you must restart Home Assistant, or else you will not be able to add *Meteo.lt* from the Integration Page.
This Integration is *not* yet a part of the default HACS store. Add it as *Custom Repository*, download it and *Meteo.lt* can be found under Integrations. Install it from there. After the installation of the files, you must restart Home Assistant, or else you will not be able to add *Meteo.lt* from the Integration Page.

If you are not familiar with HACS, or haven't installed it, I would recommend to [look through the HACS documentation](https://hacs.xyz/), before continuing. Even though you can install the Integration manually, I would recommend using HACS, as you would always be reminded when a new release is published.

Expand All @@ -33,6 +35,7 @@ If you are not familiar with HACS, or haven't installed it, I would recommend to
1. In the `custom_components` directory (folder) create a new folder called `meteo_lt`.
1. Download _all_ the files from the `custom_components/meteo_lt/` directory (folder) in this repository.
1. Place the files you downloaded in the new directory (folder) you created.
1. Added `meteo_lt:` into your `configuration.yaml`
1. Restart Home Assistant
1. In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Meteo.Lt":
- Enter latitude and longitude to use for the integration. Default values are Home Assistant Home location.
Expand Down
4 changes: 2 additions & 2 deletions custom_components/meteo_lt/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/Brunas/meteo_lt/issues",
"loggers": ["meteo_lt"],
"requirements": ["meteo_lt-pkg==0.1.6"],
"version": "0.1.7"
"requirements": ["meteo_lt-pkg==0.1.7"],
"version": "0.1.8"
}

0 comments on commit a4d2bd4

Please sign in to comment.