diff --git a/supervisor/docker/monitor.py b/supervisor/docker/monitor.py index 1fdf5f265..52d67706e 100644 --- a/supervisor/docker/monitor.py +++ b/supervisor/docker/monitor.py @@ -89,7 +89,7 @@ class DockerMonitor(CoreSysAttributes, Thread): DockerContainerStateEvent( name=attributes["name"], state=container_state, - id=event["id"], + id=event["Actor"]["ID"], time=event["time"], ), ) diff --git a/tests/docker/test_monitor.py b/tests/docker/test_monitor.py index fd9eddd1d..56653135d 100644 --- a/tests/docker/test_monitor.py +++ b/tests/docker/test_monitor.py @@ -88,7 +88,7 @@ async def test_events( ): """Test events created from docker events.""" event["Actor"]["Attributes"]["name"] = "some_container" - event["id"] = "abc123" + event["Actor"]["ID"] = "abc123" event["time"] = 123 with ( patch( @@ -131,12 +131,12 @@ async def test_unlabeled_container(coresys: CoreSys): new=PropertyMock( return_value=[ { - "id": "abc123", "time": 123, "Type": "container", "Action": "die", "Actor": { - "Attributes": {"name": "homeassistant", "exitCode": "137"} + "ID": "abc123", + "Attributes": {"name": "homeassistant", "exitCode": "137"}, }, } ]