Skip to content

Commit 565b1f6

Browse files
committed
Append timestamp to "system_was_patched" repair ticket
1 parent ce960e5 commit 565b1f6

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

custom_components/patch/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def _applied(self, files: list[PatchType]) -> None:
283283
ir.async_create_issue(
284284
self._hass,
285285
DOMAIN,
286-
"system_was_patched",
286+
"system_was_patched_" + str(int(dt_util.now().timestamp())),
287287
is_fixable=False,
288288
is_persistent=True,
289289
learn_more_url="https://github.com/amitfin/patch#configuration",

tests/test_init.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ async def test_patch( # noqa: PLR0913
171171
if update:
172172
assert repairs[0].data["action"] == "create"
173173
assert repairs[0].data["domain"] == DOMAIN
174-
assert repairs[0].data["issue_id"] == "system_was_patched"
174+
assert repairs[0].data["issue_id"].startswith("system_was_patched")
175175
if restart:
176176
assert async_call_mock.await_args_list[0].args[0] == ha.DOMAIN
177177
assert (
@@ -226,7 +226,7 @@ async def test_patch_url(
226226
with (Path(destination) / "file").open(encoding="ascii") as file:
227227
assert file.read() == "new"
228228
assert async_call_mock.call_count == 1
229-
assert repairs[0].data["issue_id"] == "system_was_patched"
229+
assert repairs[0].data["issue_id"].startswith("system_was_patched")
230230

231231

232232
@pytest.mark.allowed_logs(

0 commit comments

Comments
 (0)