Skip to content

Commit

Permalink
Merge pull request #77 from Necroneco/fix
Browse files Browse the repository at this point in the history
fix `StopIteration` error
  • Loading branch information
mypal authored Aug 12, 2024
2 parents 6b0d4c9 + 50ff16d commit 872d868
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/ds_air/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ async def async_step_bind_sensors(self, user_input: dict[str, Any] | None = None
return self.async_create_entry(title="", data={"link": self._config_data})
cur_climate: str = self._climates[self._cur]
cur_links = self.config_entry.options.get("link", [])
cur_link = next(link for link in cur_links if link["climate"] == cur_climate)
cur_link = next((link for link in cur_links if link["climate"] == cur_climate), None)
cur_sensor_temp = cur_link.get("sensor_temp") if cur_link else None
cur_sensor_humi = cur_link.get("sensor_humi") if cur_link else None
return self.async_show_form(
Expand Down

0 comments on commit 872d868

Please sign in to comment.