mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 08:07:45 +00:00
Remove OrderedDict from entity_values as dict guarantees order on newer cpython (#118081)
This commit is contained in:
parent
f026083712
commit
3416162fdb
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections import OrderedDict
|
|
||||||
import fnmatch
|
import fnmatch
|
||||||
from functools import lru_cache
|
from functools import lru_cache
|
||||||
import re
|
import re
|
||||||
@ -36,9 +35,9 @@ class EntityValues:
|
|||||||
if glob is None:
|
if glob is None:
|
||||||
compiled: dict[re.Pattern[str], Any] | None = None
|
compiled: dict[re.Pattern[str], Any] | None = None
|
||||||
else:
|
else:
|
||||||
compiled = OrderedDict()
|
compiled = {
|
||||||
for key, value in glob.items():
|
re.compile(fnmatch.translate(key)): value for key, value in glob.items()
|
||||||
compiled[re.compile(fnmatch.translate(key))] = value
|
}
|
||||||
|
|
||||||
self._glob = compiled
|
self._glob = compiled
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user