Skip to content

Commit

Permalink
V2 (#166)
Browse files Browse the repository at this point in the history
* init

* Fixing dataclass

* more fixes

* minor things

* ...

* ....

* use async_forward_entry_setups

* remove duplicated object keys

* update dev dependecies

* Update github workflow actions

* Update github workflow actions

* update pre-commit hooks

* sort mainfest keys

* add back ToyotaEntityDescription

* use latest commit state from durgnomis

* remove labeler from PR and fix some sensor dataclasses and keys

* remove further unused translation strings

* lift code in sensor return statement

* update type hints

* update type hints

* move assignment cloder to usage

* replace if expressions with or

* use more consistent var naming in init file

* simplify determination of unit system

* harmonize entity description

* harmonize entity description

* add type hints

* comment out some sensors for easier debugging

* fix licsensor platform and bring back license plate sensor

* fix and bring back statistics sensors

* bring back batteryHealth

* bring back odometer

* bring back fuel level

* remove for now unused sensors

* pin to mytoyota 0.9.3 and run poetry update

* Pin MyToyota to 0.9.3 in  manifest.json

* add .vscode to gitignore file

* drop prettier in favour of black

* move period handling for statistics in seperate function

* fix day statistics

* Remove note about only working with old app

---------

Co-authored-by: DurgNomis-drol <simongrud@gmail.com>
Co-authored-by: Simon Hansen <67142049+DurgNomis-drol@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 16, 2023
1 parent 9defcab commit 561c25a
Show file tree
Hide file tree
Showing 26 changed files with 1,997 additions and 1,822 deletions.
35 changes: 16 additions & 19 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
name: Linting
---
name: "Linting"

on:
push:
branches:
- master
branches: ["master", "main"]
pull_request:

jobs:
pre-commit:
name: Pre-commit
name: "Pre-commit"
strategy:
matrix:
python-version: [3.11]
runs-on: ubuntu-latest
runs-on: "ubuntu-latest"
steps:
- name: Check out the repository
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: "⤵️ Check out code from GitHub"
uses: "actions/checkout@v4"
- name: "🐍 Set up Python ${{ matrix.python-version }}"
uses: "actions/setup-python@v4"
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: abatilo/actions-poetry@v2.3.0

- name: Install dependencies
run: poetry install

- name: Run pre-commit on all files
python-version: "${{ matrix.python-version }}"
- name: "⚙️ Install Poetry"
uses: "abatilo/actions-poetry@v2.3.0"
- name: "⚙️ Install dependencies"
run: "poetry install"
- name: "🚀 Run pre-commit on all files"
run: |
poetry run pre-commit install
poetry run pre-commit run --all-files --show-diff-on-failure --color=always
16 changes: 8 additions & 8 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: Draft a release note
---
name: "Draft a release note"

on:
push:
branches:
- master
branches: ["master", "main"]

jobs:
draft_release:
name: Release Drafter
runs-on: ubuntu-latest
name: "Release Drafter"
runs-on: "ubuntu-latest"
steps:
- name: Run release-drafter
uses: release-drafter/release-drafter@v5.15.0
- name: "🚀 Run release-drafter"
uses: "release-drafter/release-drafter@v5"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
39 changes: 19 additions & 20 deletions .github/workflows/update-manifest.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
name: Release
---
name: "Release"

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

jobs:
release_zip_file:
name: Prepare release asset
runs-on: ubuntu-latest
name: "Prepare release asset"
runs-on: "ubuntu-latest"
steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Get version
id: version
uses: home-assistant/actions/helpers/version@master

- name: "Set version number"
- name: "⤵️ Check out code from GitHub"
uses: "actions/checkout@v4"
- name: "⚙️ Get version"
id: "version"
uses: "home-assistant/actions/helpers/version@master"
- name: "⚙️ Set version number"
run: |
python3 ${{ github.workspace }}/.github/scripts/update_manifest.py --version ${{ steps.version.outputs.version }}
- name: Create zip
"python3 ${{ github.workspace }}/.github/scripts/update_manifest.py --version ${{ steps.version.outputs.version }}"
- name: "📦 Create zip"
run: |
cd custom_components/toyota
zip toyota.zip -r ./
- name: Upload zip to release
uses: svenstaro/upload-release-action@v1-release
- name: "⬆️ Upload zip to release"
uses: "svenstaro/upload-release-action@v2"
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./custom_components/toyota/toyota.zip
asset_name: toyota.zip
tag: ${{ github.ref }}
repo_token: "${{ secrets.GITHUB_TOKEN }}"
file: "./custom_components/toyota/toyota.zip"
asset_name: "toyota.zip"
tag: "${{ github.ref }}"
overwrite: true
26 changes: 13 additions & 13 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
name: Validate
---
name: "Validate"

on:
push:
branches:
- master
branches: ["master", "main"]
pull_request:
schedule:
- cron: "0 0 * * *"

jobs:
hacs:
runs-on: ubuntu-latest
name: HACS
runs-on: "ubuntu-latest"
name: "HACS"
steps:
- name: Check out the repository
uses: "actions/checkout@v3"
- name: HACS validation
- name: "⤵️ Check out code from GitHub"
uses: "actions/checkout@v4"
- name: "🏠 HACS validation"
uses: "hacs/action@main"
with:
category: "integration"

hassfest:
runs-on: ubuntu-latest
name: Hassfest
runs-on: "ubuntu-latest"
name: "Hassfest"
steps:
- name: Check out the repository
uses: "actions/checkout@v3"
- name: Hassfest validation
- name: "⤵️ Check out code from GitHub"
uses: "actions/checkout@v4"
- name: "🏠 Hassfest validation"
uses: "home-assistant/actions/hassfest@master"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ celerybeat.pid
# Environments
.env
.venv
.vscode
env/
venv/
ENV/
Expand Down
8 changes: 3 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-yaml
- id: check-toml
- id: check-xml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: local
Expand All @@ -19,7 +21,3 @@ repos:
entry: poetry run ruff
language: system
types: [python]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.2.1
hooks:
- id: prettier
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
[![GitHub Activity][commits-shield]][commits]
[![Installs][installs-shield]][installs]

# IMPORTANT! --> This only works with old Myt by Toyota app. If you have moved to the new app this wont work for you unfortunatly.

<p align="center">
<img src="https://brands.home-assistant.io/_/toyota/icon@2x.png" alt="logo" height="200">
</p>
Expand Down
Loading

0 comments on commit 561c25a

Please sign in to comment.