From 8738c76386616ecf1ab0a49f2af024dea6cb76ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20Gl=C3=B6ckner?= <94395668+Glockner00@users.noreply.github.com> Date: Fri, 25 Sep 2026 14:05:49 +0200 Subject: [PATCH] Fix proxmox snapshot button sending name instead of snapname (#183042) --- homeassistant/components/proxmoxve/button.py | 4 ++-- tests/components/proxmoxve/test_button.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/proxmoxve/button.py b/homeassistant/components/proxmoxve/button.py index b5422c97a4bc..dd09ae4a7965 100644 --- a/homeassistant/components/proxmoxve/button.py +++ b/homeassistant/components/proxmoxve/button.py @@ -177,7 +177,7 @@ VM_BUTTONS: tuple[ProxmoxVMButtonEntityDescription, ...] = ( coordinator.proxmox.nodes(node) .qemu(vmid) .snapshot.post( - name=f"homeassistant_snapshot_{dt_util.utcnow().strftime('%Y%m%d%H%M%S')}" + snapname=f"homeassistant_snapshot_{dt_util.utcnow().strftime('%Y%m%d%H%M%S')}" ) ), permission=ProxmoxPermission.SNAPSHOT, @@ -217,7 +217,7 @@ CONTAINER_BUTTONS: tuple[ProxmoxContainerButtonEntityDescription, ...] = ( coordinator.proxmox.nodes(node) .lxc(vmid) .snapshot.post( - name=f"homeassistant_snapshot_{dt_util.utcnow().strftime('%Y%m%d%H%M%S')}" + snapname=f"homeassistant_snapshot_{dt_util.utcnow().strftime('%Y%m%d%H%M%S')}" ) ), permission=ProxmoxPermission.SNAPSHOT, diff --git a/tests/components/proxmoxve/test_button.py b/tests/components/proxmoxve/test_button.py index 83e801ef53e1..fc4cfe003e59 100644 --- a/tests/components/proxmoxve/test_button.py +++ b/tests/components/proxmoxve/test_button.py @@ -176,9 +176,9 @@ async def test_snapshot_button( # Proxmox validates the name as a `pve-configid` of at most 40 characters: # two or more, starting with a letter, then only [A-Za-z0-9_-] - name = method_mock.call_args.kwargs["name"] - assert len(name) <= 40 - assert re.fullmatch(r"[A-Za-z][A-Za-z0-9_-]+", name) + snapname = method_mock.call_args.kwargs["snapname"] + assert len(snapname) <= 40 + assert re.fullmatch(r"[A-Za-z][A-Za-z0-9_-]+", snapname) @pytest.mark.parametrize(