Only replace topic (#4884)

This commit is contained in:
Nicolas Mowen 2023-01-03 18:25:15 -07:00 committed by GitHub
parent bc5aa1141a
commit d547680116
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,7 +85,7 @@ class MqttClient(Communicator): # type: ignore[misc]
self, client: mqtt.Client, userdata: Any, message: mqtt.MQTTMessage self, client: mqtt.Client, userdata: Any, message: mqtt.MQTTMessage
) -> None: ) -> None:
self._dispatcher( self._dispatcher(
message.topic.replace(f"{self.mqtt_config.topic_prefix}/", ""), message.topic.replace(f"{self.mqtt_config.topic_prefix}/", "", 1),
message.payload.decode(), message.payload.decode(),
) )