Cleanup redundant mqtt entity constructors (#100939)

* Remove redundant mqtt entity constructors

* Remove unrelated change

* Follow up comment

* Revert changes to mqtt update platform

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Jan Bouwhuis 2023-09-26 23:03:11 +02:00 committed by GitHub
parent d387308f3c
commit 59a26010ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 27 additions and 275 deletions

View file

@ -220,6 +220,9 @@ async def _async_setup_entity(
class MqttFan(MqttEntity, FanEntity):
"""A MQTT fan component."""
_attr_percentage: int | None = None
_attr_preset_mode: str | None = None
_default_name = DEFAULT_NAME
_entity_id_format = fan.ENTITY_ID_FORMAT
_attributes_extra_blocked = MQTT_FAN_ATTRIBUTES_BLOCKED
@ -237,19 +240,6 @@ class MqttFan(MqttEntity, FanEntity):
_payload: dict[str, Any]
_speed_range: tuple[int, int]
def __init__(
self,
hass: HomeAssistant,
config: ConfigType,
config_entry: ConfigEntry,
discovery_data: DiscoveryInfoType | None,
) -> None:
"""Initialize the MQTT fan."""
self._attr_percentage = None
self._attr_preset_mode = None
MqttEntity.__init__(self, hass, config, config_entry, discovery_data)
@staticmethod
def config_schema() -> vol.Schema:
"""Return the config schema."""