Replace lambda with attrgetter in device_tracker device_trigger (#99663)
This commit is contained in:
parent
035fea3ee0
commit
a04c61e77b
1 changed files with 2 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
"""Provides device automations for Device Tracker."""
|
||||
from __future__ import annotations
|
||||
|
||||
from operator import attrgetter
|
||||
from typing import Final
|
||||
|
||||
import voluptuous as vol
|
||||
|
@ -98,7 +99,7 @@ async def async_get_trigger_capabilities(
|
|||
"""List trigger capabilities."""
|
||||
zones = {
|
||||
ent.entity_id: ent.name
|
||||
for ent in sorted(hass.states.async_all(DOMAIN_ZONE), key=lambda ent: ent.name)
|
||||
for ent in sorted(hass.states.async_all(DOMAIN_ZONE), key=attrgetter("name"))
|
||||
}
|
||||
return {
|
||||
"extra_fields": vol.Schema(
|
||||
|
|
Loading…
Add table
Reference in a new issue