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

@ -98,22 +98,11 @@ class MqttBinarySensor(MqttEntity, BinarySensorEntity, RestoreEntity):
"""Representation a binary sensor that is updated by MQTT."""
_default_name = DEFAULT_NAME
_delay_listener: CALLBACK_TYPE | None = None
_entity_id_format = binary_sensor.ENTITY_ID_FORMAT
_expired: bool | None
_expire_after: int | None
def __init__(
self,
hass: HomeAssistant,
config: ConfigType,
config_entry: ConfigEntry,
discovery_data: DiscoveryInfoType | None,
) -> None:
"""Initialize the MQTT binary sensor."""
self._expiration_trigger: CALLBACK_TYPE | None = None
self._delay_listener: CALLBACK_TYPE | None = None
MqttEntity.__init__(self, hass, config, config_entry, discovery_data)
_expiration_trigger: CALLBACK_TYPE | None = None
async def mqtt_async_added_to_hass(self) -> None:
"""Restore state for entities with expire_after set."""