Remove unreachable code in the ESPHome fan platform (#96458)

This commit is contained in:
J. Nick Koston 2023-07-14 13:37:16 -10:00 committed by GitHub
parent 81ce6e4797
commit 9775832d53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -119,9 +119,6 @@ class EsphomeFan(EsphomeEntity[FanInfo, FanState], FanEntity):
@esphome_state_property
def percentage(self) -> int | None:
"""Return the current speed percentage."""
if not self._static_info.supports_speed:
return None
if not self._supports_speed_levels:
return ordered_list_item_to_percentage(
ORDERED_NAMED_FAN_SPEEDS, self._state.speed # type: ignore[misc]