File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
custom_components/malaysia_weather Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -100,9 +100,12 @@ async def _async_get_locations() -> dict[str, str]:
100
100
locations [location_id ] = location_name
101
101
except Exception : # pylint: disable=broad-except
102
102
_LOGGER .exception ("Error fetching locations" )
103
-
104
- return locations
105
-
103
+
104
+ # 5/1/25 - Sort locations alphabetically by name
105
+ sorted_locations = dict (sorted (locations .items (), key = lambda x : x [1 ]))
106
+ return sorted_locations
107
+ # return locations
108
+
106
109
@staticmethod
107
110
@callback
108
111
def async_get_options_flow (
@@ -177,4 +180,4 @@ async def async_step_init(
177
180
178
181
179
182
class InvalidLocation (HomeAssistantError ):
180
- """Error to indicate the location ID is invalid."""
183
+ """Error to indicate the location ID is invalid."""
You can’t perform that action at this time.
0 commit comments