Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions custom_components/qr_generator/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@
from typing import Any

import voluptuous as vol

from homeassistant import config_entries
from homeassistant.const import CONF_NAME, CONF_VALUE_TEMPLATE
from homeassistant.core import callback
from homeassistant.data_entry_flow import FlowResult
from homeassistant.exceptions import TemplateError
from homeassistant.helpers import config_validation as cv, template
from homeassistant.helpers.selector import TextSelector, TextSelectorConfig, TextSelectorType
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers import template
from homeassistant.helpers.selector import (
TextSelector,
TextSelectorConfig,
TextSelectorType,
)

from .const import (
CONF_ADVANCED,
Expand Down Expand Up @@ -85,7 +89,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):

VERSION: int = 1

override_config: dict[str, Any] = {}
override_config: dict[str, Any] = {} # ruff: ignore[mutable-class-default]

def __init__(self) -> None:
"""Initialize the config flow."""
Expand Down
9 changes: 4 additions & 5 deletions custom_components/qr_generator/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,18 @@
import io
from typing import Any

from PIL import ImageColor
import pyqrcode

from homeassistant.util import dt as dt_util
from PIL import ImageColor
from homeassistant.components.image import ImageEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_NAME, CONF_VALUE_TEMPLATE
from homeassistant.core import HomeAssistant, callback, Event, EventStateChangedData
from homeassistant.core import Event, EventStateChangedData, HomeAssistant, callback
from homeassistant.helpers import template
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.event import async_track_state_change_event
from homeassistant.util import dt as dt_util

from .const import (
_LOGGER,
ATTR_BACKGROUND_COLOR,
ATTR_BORDER,
ATTR_COLOR,
Expand All @@ -35,6 +33,7 @@
DEFAULT_COLOR,
DEFAULT_ERROR_CORRECTION,
DEFAULT_SCALE,
_LOGGER,
)


Expand Down
5 changes: 2 additions & 3 deletions custom_components/qr_generator/services.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import os

import voluptuous as vol
from homeassistant.components.image import ImageEntity
from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.core import HomeAssistant, ServiceCall
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.entity_platform import async_get_platforms

from custom_components.qr_generator import DOMAIN
import voluptuous as vol
from homeassistant.helpers import config_validation as cv

from custom_components.qr_generator.const import ATTR_FILENAME, _LOGGER


Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@ dev = [
"pytest-homeassistant-custom-component"
]
lint = [
"ruff>=0.12.0"
"ruff>=0.16.0"
]

[tool.ruff]
preview = true

[tool.ruff.lint]
ignore = ["EXE002"]

[tool.ruff.lint.isort]
case-sensitive = true

Expand Down
2 changes: 0 additions & 2 deletions tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
from typing import Any

import pytest

from homeassistant.config_entries import ConfigEntryState
from homeassistant.const import CONF_NAME, CONF_VALUE_TEMPLATE
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er

from pytest_homeassistant_custom_component.common import MockConfigEntry

from custom_components.qr_generator.const import (
Expand Down
44 changes: 22 additions & 22 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.