Skip to content

Commit

Permalink
Remove change entity flow (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeerMaximum authored Jan 17, 2024
1 parent 3bf66b7 commit 5d65e9a
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 63 deletions.
42 changes: 0 additions & 42 deletions custom_components/ta_coe/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ async def async_step_init(
menu_options=[
"general",
"add_send_values",
"change_send_values",
"delete_send_values",
],
)
Expand Down Expand Up @@ -278,47 +277,6 @@ async def async_step_add_send_values(
errors=errors,
)

async def async_step_change_send_values(
self, user_input: dict[str, Any] | None = None
) -> FlowResult:
"""Handle options change sensors send via CoE."""
errors: dict[str, Any] = {}

if user_input is not None:
new_id = user_input[CONF_ENTITIES_TO_SEND]
old_id = user_input["old_value"]

if (
(
old_id in self.data[CONF_ENTITIES_TO_SEND].values()
or new_id not in self.data[CONF_ENTITIES_TO_SEND].values()
)
and old_id not in FREE_SLOT_MARKERS
and new_id not in FREE_SLOT_MARKERS
):
index = [
k
for k, v in self.data[CONF_ENTITIES_TO_SEND].items()
if v == old_id
][0]

self.data[CONF_ENTITIES_TO_SEND][index] = new_id

return self.async_create_entry(title="", data=self.data)

errors["base"] = "invalid_entity"

return self.async_show_form(
step_id="change_send_values",
data_schema=vol.Schema(
{
vol.Required(CONF_ENTITIES_TO_SEND): cv.string,
vol.Required("old_value"): cv.string,
}
),
errors=errors,
)

async def async_step_delete_send_values(self, user_input=None):
"""Handle options remove sensors send via CoE."""
errors: dict[str, Any] = {}
Expand Down
7 changes: 0 additions & 7 deletions custom_components/ta_coe/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@
"entities_to_send": "Entity id to send"
}
},
"change_send_values": {
"title": "Change sensors",
"data": {
"old_value": "ID to override",
"entities_to_send": "New ID"
}
},
"delete_send_values": {
"title": "Delete sensors",
"data": {
Expand Down
7 changes: 0 additions & 7 deletions custom_components/ta_coe/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@
"entities_to_send": "ID der Entität zum senden"
}
},
"change_send_values": {
"title": "Sensoren ändern",
"data": {
"old_value": "Alte ID",
"entities_to_send": "Neu ID"
}
},
"delete_send_values": {
"title": "Sensoren löschen",
"data": {
Expand Down
7 changes: 0 additions & 7 deletions custom_components/ta_coe/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@
"entities_to_send": "Entity id to send"
}
},
"change_send_values": {
"title": "Change sensors",
"data": {
"old_value": "ID to override",
"entities_to_send": "New ID"
}
},
"delete_send_values": {
"title": "Delete sensors",
"data": {
Expand Down

0 comments on commit 5d65e9a

Please sign in to comment.