From 12f22d53b33a52da96bfd58886f09039101e16f2 Mon Sep 17 00:00:00 2001 From: Michael Arthur Date: Thu, 19 Sep 2024 12:35:08 +1200 Subject: [PATCH 1/2] set a better default also fixes error with index which does exist --- custom_components/mammotion/switch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/mammotion/switch.py b/custom_components/mammotion/switch.py index f8983ee..8dcbea8 100644 --- a/custom_components/mammotion/switch.py +++ b/custom_components/mammotion/switch.py @@ -97,11 +97,11 @@ def add_entities() -> None: area_name = coordinator.data.map.area_name new_areas = areas - added_areas if new_areas: - for index, area_id in new_areas: + for area_id in new_areas: existing_name: AreaHashName = next( (area for area in area_name if area.hash.__str__() == area_id), None ) - name = existing_name.name if existing_name else f"area {index+1}" + name = existing_name.name if existing_name else f"mowing area {area_id}" base_area_switch_entity = MammotionConfigAreaSwitchEntityDescription( key=f"{area_id}", area=area_id, From 0ee2a91f19d369f638897c1c81a6f909f6dab794 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 19 Sep 2024 00:35:31 +0000 Subject: [PATCH 2/2] Bump version to 0.1.39 --- custom_components/mammotion/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/mammotion/manifest.json b/custom_components/mammotion/manifest.json index 96e363e..119d82a 100644 --- a/custom_components/mammotion/manifest.json +++ b/custom_components/mammotion/manifest.json @@ -1,7 +1,7 @@ { "domain": "mammotion", "name": "Mammotion", - "version": "0.1.38", + "version": "0.1.39", "issue_tracker": "https://github.com/mikey0000/Mammotion-HA/issues", "integration_type": "device", "bluetooth": [