Skip to content

Commit

Permalink
Draft new options flow handler
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-codechimp committed Nov 28, 2024
1 parent 7ca29d9 commit bea6abc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions custom_components/battery_notes/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ class BatteryNotesFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@callback
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlow:
# pylint: disable=unused-argument
"""Get the options flow for this handler."""
return OptionsFlowHandler(config_entry)
return OptionsFlowHandler()

async def async_step_integration_discovery(
self,
Expand All @@ -143,6 +144,7 @@ async def async_step_user(
self,
user_input: dict | None = None,
) -> config_entries.FlowResult:
# pylint: disable=unused-argument
"""Handle a flow initialized by the user."""

return self.async_show_menu(step_id="user", menu_options=["device", "entity"])
Expand Down Expand Up @@ -424,10 +426,9 @@ class OptionsFlowHandler(OptionsFlow):

model_info: ModelInfo = None

def __init__(self, config_entry: ConfigEntry) -> None:
def __init__(self) -> None:
"""Initialize options flow."""
self.config_entry = config_entry
self.current_config: dict = dict(config_entry.data)
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)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/battery_notes/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

LOGGER: Logger = getLogger(__package__)

MIN_HA_VERSION = "2024.10"
MIN_HA_VERSION = "2024.12"

manifestfile = Path(__file__).parent / "manifest.json"
with open(file=manifestfile, encoding="UTF-8") as json_file:
Expand Down
2 changes: 1 addition & 1 deletion hacs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Battery Notes",
"filename": "battery_notes.zip",
"hide_default_branch": true,
"homeassistant": "2024.10.0",
"homeassistant": "2024.12.0",
"render_readme": true,
"zip_release": true,
"persistent_directory": "data"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repository = "https://github.com/andrew-codechimp/HA-Battery-Notes"
version = "0.0.0"

[tool.poetry.dependencies]
homeassistant = "2024.10.0"
homeassistant = "2024.12.0"
python = ">=3.12,<3.13"

[tool.poetry.group.dev.dependencies]
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.10.0
homeassistant==2024.12.0
ruff>=0.5.0,<0.8

0 comments on commit bea6abc

Please sign in to comment.