diff --git a/.devcontainer/integration/devcontainer.json b/.devcontainer/integration/devcontainer.json index e4b0567b0..411591b9a 100644 --- a/.devcontainer/integration/devcontainer.json +++ b/.devcontainer/integration/devcontainer.json @@ -1,6 +1,6 @@ { "name": "BN Integration", - "image": "mcr.microsoft.com/devcontainers/python:3.12", + "image": "mcr.microsoft.com/devcontainers/python:dev-3.13", "features": { "ghcr.io/devcontainers/features/github-cli:1": { "installDirectlyFromGitHubRelease": true, diff --git a/custom_components/battery_notes/config_flow.py b/custom_components/battery_notes/config_flow.py index ed943b68f..057921d5a 100644 --- a/custom_components/battery_notes/config_flow.py +++ b/custom_components/battery_notes/config_flow.py @@ -351,9 +351,7 @@ async def async_step_battery(self, user_input: dict[str, Any] | None = None): if source_entity_id: entity_registry = er.async_get(self.hass) entity_entry = entity_registry.async_get(source_entity_id) - source_entity_domain, source_object_id = split_entity_id( - source_entity_id - ) + _, source_object_id = split_entity_id(source_entity_id) entity_unique_id = ( entity_entry.unique_id or entity_entry.entity_id or source_object_id ) @@ -428,14 +426,12 @@ class OptionsFlowHandler(OptionsFlow): def __init__(self) -> None: """Initialize options flow.""" - self.current_config: dict = dict(self.config_entry.data) - self.source_device_id: str = self.current_config.get(CONF_DEVICE_ID) # type: ignore - self.name: str = self.current_config.get(CONF_NAME) - self.battery_type: str = self.current_config.get(CONF_BATTERY_TYPE) - self.battery_quantity: int = self.current_config.get(CONF_BATTERY_QUANTITY) - self.battery_low_template: str = self.current_config.get( - CONF_BATTERY_LOW_TEMPLATE - ) + self.current_config: dict + self.source_device_id: str + self.name: str + self.battery_type: str + self.battery_quantity: int + self.battery_low_template: str async def async_step_init( self, @@ -444,6 +440,11 @@ async def async_step_init( """Handle options flow.""" errors = {} self.current_config = dict(self.config_entry.data) + self.source_device_id = self.current_config.get(CONF_DEVICE_ID) # type: ignore + self.name = self.current_config.get(CONF_NAME) + self.battery_type = self.current_config.get(CONF_BATTERY_TYPE) + self.battery_quantity = self.current_config.get(CONF_BATTERY_QUANTITY) + self.battery_low_template = self.current_config.get(CONF_BATTERY_LOW_TEMPLATE) if self.source_device_id: device_registry = dr.async_get(self.hass) diff --git a/pyproject.toml b/pyproject.toml index 734cbba51..69487fed3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,11 +24,10 @@ homeassistant = "2024.12.0" python = ">=3.12,<3.13" [tool.poetry.group.dev.dependencies] -hass-nabucasa = "0.84.0" pre-commit = "4.0.1" pre-commit-hooks = "5.0.0" pylint = "3.1.0" -ruff = "0.7.3" +ruff = "0.8.2" [tool.poetry.urls] "Bug Tracker" = "https://github.com/andrew-codechimp/HA-Battery-Notes/issues" diff --git a/requirements.txt b/requirements.txt index be6e81e62..b663c744d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ colorlog>=6.8.2,<7.0 homeassistant==2024.12.0 -ruff>=0.5.0,<0.8 +ruff>=0.5.0,<0.8.2