Switch homekit config flow sorted to use itemgetter (#99658)
Avoids unnecessary lambda
This commit is contained in:
parent
a2dae60170
commit
e22b03d6b3
1 changed files with 2 additions and 1 deletions
|
@ -3,6 +3,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
from collections.abc import Iterable
|
from collections.abc import Iterable
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
|
from operator import itemgetter
|
||||||
import random
|
import random
|
||||||
import re
|
import re
|
||||||
import string
|
import string
|
||||||
|
@ -638,7 +639,7 @@ async def _async_get_supported_devices(hass: HomeAssistant) -> dict[str, str]:
|
||||||
for device_id in results:
|
for device_id in results:
|
||||||
entry = dev_reg.async_get(device_id)
|
entry = dev_reg.async_get(device_id)
|
||||||
unsorted[device_id] = entry.name or device_id if entry else device_id
|
unsorted[device_id] = entry.name or device_id if entry else device_id
|
||||||
return dict(sorted(unsorted.items(), key=lambda item: item[1]))
|
return dict(sorted(unsorted.items(), key=itemgetter(1)))
|
||||||
|
|
||||||
|
|
||||||
def _exclude_by_entity_registry(
|
def _exclude_by_entity_registry(
|
||||||
|
|
Loading…
Add table
Reference in a new issue