Skip to content

Commit

Permalink
Merge commit 'b17b90c0c668130795a8534aff2f4fe3d16011a0'
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasddn committed Feb 7, 2025
2 parents e719399 + b17b90c commit 2ae0426
Show file tree
Hide file tree
Showing 21 changed files with 1,725 additions and 76 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,37 @@ jobs:
pip install -r requirements.txt
pip install -r requirements.test.txt
translations:
name: Check translations
runs-on: ubuntu-latest
needs:
- info
- prepare
steps:
- name: Check out code
uses: actions/checkout@v4.2.2

- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.3.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}

- name: Restore Python ${{ env.DEFAULT_PYTHON }} virtual environment
id: cache-venv
uses: actions/cache/restore@v4.2.0
with:
path: venv
fail-on-cache-miss: true
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{ needs.info.outputs.python_cache_key }}
- name: Run translations check
run: |
. venv/bin/activate
python --version
python scripts/check_translations.py --ignore-errors
mypy:
name: Check mypy
runs-on: ubuntu-latest
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish

on:
release:
types:
- published
workflow_dispatch:

jobs:
release:
name: Publish zip file
runs-on: ubuntu-latest
permissions:
contents: write
env:
INTEGRATION_PATH: ${{ github.workspace }}/custom_components/volvo_cars
steps:
- name: Check out code
uses: actions/checkout@v4.2.2

- name: Set version in manifest.json
run: |
# Extract version from tag (e.g., "refs/tags/v1.2.3" becomes "1.2.3")
version="${GITHUB_REF#refs/tags/v}"
echo "Setting version to ${version}"
# Update the "version" key in manifest.json (assumes a simple "version": "..." line)
sed -i -E "s/\"version\": \"[^\"]+\"/\"version\": \"${version}\"/" ${INTEGRATION_PATH}/manifest.json
- name: Zip
run: |
cd $INTEGRATION_PATH
zip volvo_cars.zip -r ./
pwd
ls -l *.zip
- name: Include zip in release
uses: softprops/action-gh-release@v2.2.1
with:
files: ${{ env.INTEGRATION_PATH }}/volvo_cars.zip
fail_on_unmatched_files: true
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Supported regions include: Europe, the Middle East, and Africa. For a complete l
Now check out the features section for details on what you'll get!

[![GitHub release][releases-shield]][releases]
[![Github downloads][downloads-shield]][releases]
[![CI main][ci-main-shield]][ci-workflow]
[![CI dev][ci-dev-shield]][ci-workflow]
[![HACS][hacs-shield]][hacs]
Expand All @@ -21,7 +22,7 @@ Now check out the features section for details on what you'll get!

- Multiple cars
- Multiple accounts
- Multiple languages: Dutch (nl), English (en), German (de), Norwegian (no), Polish (pl), Portuguese (pt & pt-BR), Swedish (sv)
- Multiple languages: Dutch (nl), English (en), French (fr), German (de), Norwegian Bokmål (nb), Polish (pl), Portuguese Brazil (pt-BR), Portuguese Portugal (pt), Swedish (sv)

<br>

Expand Down Expand Up @@ -165,7 +166,8 @@ Once a car has been added, you can configure additional options for it.
| ----------------------------- | ------------------------------------------------------------------------- | ----------------------------------------------------- |
| Volvo API key | The generated API key in the developer account. | |
| Device tracker picture | The picture that will be shown on the map. | |
| Fuel consumption unit | You can choose between `l/100km`, `mpg (UK)` and `mpg (US)`. | Cars with a combustion engine. |
| Energy consumption unit | You can choose between `kWh/100 km` and `mi/kWh`. | Cars with a battery engine. |
| Fuel consumption unit | You can choose between `l/100 km`, `mpg (UK)` and `mpg (US)` | Cars with a combustion engine. |
| Images transparent background | Whether or not you want transparent a background for the exterior images. | Depending on the image URL provided by the Volvo API. |
| Images background color | Choose the background color for the exterior images. | Depending on the image URL provided by the Volvo API. |

Expand Down Expand Up @@ -214,6 +216,7 @@ When I'm coding, I run on coffee, Coca-Cola*, and Lays* potato chips. If you'd l
<sub><sub>\* No affiliation with these brands — just personal favorites!</sub></sub>

[releases-shield]: https://img.shields.io/github/v/release/thomasddn/ha-volvo-cars?style=flat-square
[downloads-shield]: https://img.shields.io/github/downloads/thomasddn/ha-volvo-cars/total?style=flat-square
[releases]: https://github.com/thomasddn/ha-volvo-cars/releases
[ci-dev-shield]: https://img.shields.io/github/actions/workflow/status/thomasddn/ha-volvo-cars/ci.yml?branch=develop&style=flat-square&label=develop
[ci-main-shield]: https://img.shields.io/github/actions/workflow/status/thomasddn/ha-volvo-cars/ci.yml?branch=main&style=flat-square&label=main
Expand Down
Loading

0 comments on commit 2ae0426

Please sign in to comment.