mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
Use assignment expressions 19 (#57968)
This commit is contained in:
@@ -109,8 +109,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
if sensor_names is not None:
|
||||
name = sensor_names.get(int(elem["id"]), None)
|
||||
|
||||
unit = elem.get("unit")
|
||||
if unit:
|
||||
if unit := elem.get("unit"):
|
||||
unit_of_measurement = unit
|
||||
else:
|
||||
unit_of_measurement = config_unit
|
||||
|
||||
Reference in New Issue
Block a user