Switch homekit config flow sorted to use itemgetter (#99658)

Avoids unnecessary lambda
pull/99703/head
J. Nick Koston 2023-09-05 20:18:46 -05:00 committed by GitHub
parent a2dae60170
commit e22b03d6b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@ from __future__ import annotations
from collections.abc import Iterable
from copy import deepcopy
from operator import itemgetter
import random
import re
import string
@ -638,7 +639,7 @@ async def _async_get_supported_devices(hass: HomeAssistant) -> dict[str, str]:
for device_id in results:
entry = dev_reg.async_get(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(