Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-codechimp committed Dec 9, 2024
1 parent bea6abc commit e77563f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/integration/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
23 changes: 12 additions & 11 deletions custom_components/battery_notes/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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,
Expand All @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e77563f

Please sign in to comment.