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

Remove str as a valid HVACMode & HVACAction type #94644

Merged
merged 3 commits into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions homeassistant/components/climate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ class ClimateEntity(Entity):
_attr_current_temperature: float | None = None
_attr_fan_mode: str | None
_attr_fan_modes: list[str] | None
_attr_hvac_action: HVACAction | str | None = None
_attr_hvac_mode: HVACMode | str | None
_attr_hvac_modes: list[HVACMode] | list[str]
_attr_hvac_action: HVACAction | None = None
_attr_hvac_mode: HVACMode | None
_attr_hvac_modes: list[HVACMode]
_attr_is_aux_heat: bool | None
_attr_max_humidity: int = DEFAULT_MAX_HUMIDITY
_attr_max_temp: float
Expand Down Expand Up @@ -361,17 +361,17 @@ def target_humidity(self) -> int | None:
return self._attr_target_humidity

@property
def hvac_mode(self) -> HVACMode | str | None:
def hvac_mode(self) -> HVACMode | None:
"""Return hvac operation ie. heat, cool mode."""
return self._attr_hvac_mode

@property
def hvac_modes(self) -> list[HVACMode] | list[str]:
def hvac_modes(self) -> list[HVACMode]:
"""Return the list of available hvac operation modes."""
return self._attr_hvac_modes

@property
def hvac_action(self) -> HVACAction | str | None:
def hvac_action(self) -> HVACAction | None:
"""Return the current running hvac operation if supported."""
return self._attr_hvac_action

Expand Down
6 changes: 3 additions & 3 deletions pylint/plugins/hass_enforce_type_hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -1023,15 +1023,15 @@ class ClassTypeHintMatch:
),
TypeHintMatch(
function_name="hvac_mode",
return_type=["HVACMode", "str", None],
return_type=["HVACMode", None],
),
TypeHintMatch(
function_name="hvac_modes",
return_type=["list[HVACMode]", "list[str]"],
return_type="list[HVACMode]",
),
TypeHintMatch(
function_name="hvac_action",
return_type=["HVACAction", "str", None],
return_type=["HVACAction", None],
),
TypeHintMatch(
function_name="current_temperature",
Expand Down