Use assignment expressions 17 (#57963)
Co-authored-by: Tobias Sauerwein <cgtobi@users.noreply.github.com>
This commit is contained in:
parent
326a302c22
commit
9a58bfdf41
15 changed files with 30 additions and 56 deletions
|
@ -109,9 +109,8 @@ async def async_setup_entry(
|
|||
discovery_info = config_entry.data
|
||||
|
||||
def get_sensor_description(type_string: str):
|
||||
description = SENSOR_TYPES_DICT.get(type_string)
|
||||
if description is None:
|
||||
description = BinarySensorEntityDescription(key=type_string)
|
||||
if (description := SENSOR_TYPES_DICT.get(type_string)) is None:
|
||||
return BinarySensorEntityDescription(key=type_string)
|
||||
return description
|
||||
|
||||
for packet_id, entity_info in discovery_info[CONF_DEVICES].items():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue