Skip to content

Commit

Permalink
Add reconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
theneweinstein committed Apr 21, 2024
1 parent d125e6f commit 9bb9470
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
18 changes: 17 additions & 1 deletion custom_components/somneo/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,22 @@ async def async_step_user(
step_id="user", data_schema=_base_schema(self.discovery_info), errors=errors
)

async def async_step_reconfigure(
self, _: dict[str, Any] | None = None
) -> FlowResult:
"""Handle reconfiguration."""
_entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])

return self.async_show_form(
step_id="user",
data_schema=self.add_suggested_values_to_schema(
_base_schema(self.discovery_info),
_entry.data
),
)



@staticmethod
@callback
def async_get_options_flow(
Expand All @@ -120,7 +136,7 @@ def async_get_options_flow(
return SomneoOptionsFlow(config_entry)

class SomneoOptionsFlow(config_entries.OptionsFlow):
"""Config flow options for Somneo"""
"""Config flow options for Somneo."""

def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
"""Initialze the Somneo options flow."""
Expand Down
2 changes: 1 addition & 1 deletion custom_components/somneo/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
"modelName": "Wake-up Light"
}
],
"version": "2024.3.0"
"version": "2024.4.0"
}
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
colorlog==6.7.0
homeassistant==2024.2.0b3
homeassistant==2024.4.3
pip>=21.0,<23.2
ruff==0.0.291

0 comments on commit 9bb9470

Please sign in to comment.