Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declare local variable before use #172

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion custom_components/hiq/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def add_hvac_tags(
)

# check for existing global parameter
has_para_for_thermostat: bool = False
for hvac in hvacs:
if hvac in (
f"{unique_id}.hvac_temperature_source",
Expand All @@ -110,7 +111,8 @@ def add_hvac_tags(
f"{unique_id}.hvac_fan_option_b04",
):
has_para_for_thermostat = True
if has_para_for_thermostat is None:
break
if has_para_for_thermostat is False:
return None

# add config buttons for active thermostats
Expand Down