Skip to content

Commit

Permalink
Use walrus for unit
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinHjelmare committed Sep 13, 2021
1 parent 6641e3f commit 619dc7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/zwave_js/migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ def add_entity_value(
assert device_entry

# Normalize unit of measurement.
unit = entity_entry.unit_of_measurement
unit = unit and unit.lower()
if unit := entity_entry.unit_of_measurement:
unit = unit.lower()
if unit == "":
unit = None

Expand Down

0 comments on commit 619dc7d

Please sign in to comment.