Skip to content

Commit

Permalink
Update switch.py
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Arthur <[email protected]>
  • Loading branch information
zweckj and mikey0000 authored Nov 14, 2024
1 parent be0ecc2 commit 549bfd5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/mammotion/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def add_entities() -> None:
existing_name: AreaHashNameList | None = next(
(area for area in area_name if str(area.hash) == str(area_id)), None
)
name = existing_name.name if existing_name else f"{area_id}"
name = existing_name.name if (existing_name and existing_name.name) else f"{area_id}"
base_area_switch_entity = MammotionConfigAreaSwitchEntityDescription(
key=f"{area_id}",
translation_key="area",
Expand Down

0 comments on commit 549bfd5

Please sign in to comment.