From 3416162fdb29666ad2ea38338ac574a8d42baadb Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 24 May 2024 17:43:20 -1000 Subject: [PATCH] Remove OrderedDict from entity_values as dict guarantees order on newer cpython (#118081) --- homeassistant/helpers/entity_values.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/homeassistant/helpers/entity_values.py b/homeassistant/helpers/entity_values.py index 7e7bdc7be41..b5e46bdfe68 100644 --- a/homeassistant/helpers/entity_values.py +++ b/homeassistant/helpers/entity_values.py @@ -2,7 +2,6 @@ from __future__ import annotations -from collections import OrderedDict import fnmatch from functools import lru_cache import re @@ -36,9 +35,9 @@ class EntityValues: if glob is None: compiled: dict[re.Pattern[str], Any] | None = None else: - compiled = OrderedDict() - for key, value in glob.items(): - compiled[re.compile(fnmatch.translate(key))] = value + compiled = { + re.compile(fnmatch.translate(key)): value for key, value in glob.items() + } self._glob = compiled