Skip to content

Commit

Permalink
General updates June 2024 (#165)
Browse files Browse the repository at this point in the history
* General updates June 2024

* update

* lint

* use 0.0.0
  • Loading branch information
ludeeus authored Jun 8, 2024
1 parent 186b1e1 commit 384b980
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 39 deletions.
33 changes: 16 additions & 17 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ludeeus/integration_blueprint",
"image": "mcr.microsoft.com/devcontainers/python:3.11-bullseye",
"image": "mcr.microsoft.com/devcontainers/python:3.12",
"postCreateCommand": "scripts/setup",
"forwardPorts": [
8123
Expand All @@ -14,29 +14,28 @@
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"charliermarsh.ruff",
"github.vscode-pull-request-github",
"ryanluker.vscode-coverage-gutters",
"ms-python.vscode-pylance"
"ms-python.python",
"ms-python.vscode-pylance",
"ryanluker.vscode-coverage-gutters"
],
"settings": {
"files.eol": "\n",
"editor.tabSize": 4,
"python.pythonPath": "/usr/bin/python3",
"python.analysis.autoSearchPaths": false,
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.formatting.provider": "black",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"editor.formatOnPaste": false,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true
"editor.formatOnType": false,
"files.trimTrailingWhitespace": true,
"python.analysis.typeCheckingMode": "basic",
"python.analysis.autoImportCompletions": true,
"python.defaultInterpreterPath": "/usr/local/bin/python",
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
}
}
}
},
"remoteUser": "vscode",
"features": {
"ghcr.io/devcontainers/features/rust:1": {}
}
}
"features": {}
}
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: "Set up Python"
uses: actions/setup-python@v5.1.0
with:
python-version: "3.11"
python-version: "3.12"
cache: "pip"

- name: "Install requirements"
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,13 @@ jobs:
- name: "Checkout the repository"
uses: "actions/checkout@v4.1.6"

- name: "Adjust version number"
shell: "bash"
run: |
yq -i -o json '.version="${{ github.event.release.tag_name }}"' \
"${{ github.workspace }}/custom_components/integration_blueprint/manifest.json"
- name: "ZIP the integration directory"
shell: "bash"
run: |
cd "${{ github.workspace }}/custom_components/integration_blueprint"
zip integration_blueprint.zip -r ./
- name: "Upload the ZIP file to the release"
uses: softprops/action-gh-release@v0.1.15
uses: "softprops/action-gh-release@v0.1.15"
with:
files: ${{ github.workspace }}/custom_components/integration_blueprint/integration_blueprint.zip
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ __pycache__
.coverage
.vscode
coverage.xml
.ruff_cache


# Home Assistant configuration
Expand Down
9 changes: 5 additions & 4 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# The contents of this file is based on https://github.com/home-assistant/core/blob/dev/pyproject.toml

target-version = "py310"
target-version = "py312"

[lint]
select = [
"B007", # Loop control variable {name} not used within loop body
"B014", # Exception handler with duplicate exception
Expand Down Expand Up @@ -38,11 +39,11 @@ ignore = [
"E731", # do not assign a lambda expression, use a def
]

[flake8-pytest-style]
[lint.flake8-pytest-style]
fixture-parentheses = false

[pyupgrade]
[lint.pyupgrade]
keep-runtime-typing = true

[mccabe]
[lint.mccabe]
max-complexity = 25
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 - 2023 Joakim Sørensen @ludeeus
Copyright (c) 2019 - 2024 Joakim Sørensen @ludeeus

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ These are some next steps you may want to look into:
- Add brand images (logo/icon) to https://github.com/home-assistant/brands.
- Create your first release.
- Share your integration on the [Home Assistant Forum](https://community.home-assistant.io/).
- Submit your integration to the [HACS](https://hacs.xyz/docs/publish/start).
- Submit your integration to [HACS](https://hacs.xyz/docs/publish/start).
4 changes: 4 additions & 0 deletions config/configuration.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# https://www.home-assistant.io/integrations/default_config/
default_config:

# https://www.home-assistant.io/integrations/homeassistant/
homeassistant:
debug: true

# https://www.home-assistant.io/integrations/logger/
logger:
default: info
Expand Down
3 changes: 1 addition & 2 deletions custom_components/integration_blueprint/api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Sample API Client."""
from __future__ import annotations

import asyncio
import socket

import aiohttp
Expand Down Expand Up @@ -76,7 +75,7 @@ async def _api_wrapper(
response.raise_for_status()
return await response.json()

except asyncio.TimeoutError as exception:
except TimeoutError as exception:
raise IntegrationBlueprintApiClientCommunicationError(
"Timeout error fetching information",
) from exception
Expand Down
2 changes: 2 additions & 0 deletions custom_components/integration_blueprint/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Adds config flow for Blueprint."""

from __future__ import annotations

import voluptuous as vol
Expand All @@ -7,6 +8,7 @@
from homeassistant.helpers import selector
from homeassistant.helpers.aiohttp_client import async_create_clientsession


from .api import (
IntegrationBlueprintApiClient,
IntegrationBlueprintApiClientAuthenticationError,
Expand Down
1 change: 1 addition & 0 deletions custom_components/integration_blueprint/const.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Constants for integration_blueprint."""

from logging import Logger, getLogger

LOGGER: Logger = getLogger(__package__)
Expand Down
8 changes: 3 additions & 5 deletions hacs.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"name": "Integration blueprint",
"filename": "integration_blueprint.zip",
"hide_default_branch": true,
"homeassistant": "2023.8.0",
"render_readme": true,
"zip_release": true
}
"homeassistant": "2024.6.0",
"render_readme": true
}
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
colorlog==6.8.2
homeassistant==2023.8.0
homeassistant==2024.6.0
pip>=21.0,<24.1
ruff==0.4.8

0 comments on commit 384b980

Please sign in to comment.