@@ -720,7 +720,7 @@ def sanitize(text):
720
720
.replace ("." , "_" )
721
721
.replace ("&" , "" ))
722
722
723
- def rtl_433_device_info (data ):
723
+ def rtl_433_device_info (data , topic_prefix ):
724
724
"""Return rtl_433 device topic to subscribe to for a data element, based on the
725
725
rtl_433 device topic argument, as well as the device identifier"""
726
726
@@ -745,7 +745,7 @@ def rtl_433_device_info(data):
745
745
746
746
path = '' .join (list (filter (lambda item : item , path_elements )))
747
747
id = '-' .join (id_elements )
748
- return (path , id )
748
+ return (f" { topic_prefix } / { path } " , id )
749
749
750
750
751
751
def publish_config (mqttc , topic , model , object_id , mapping , value = None ):
@@ -793,7 +793,7 @@ def publish_config(mqttc, topic, model, object_id, mapping, value=None):
793
793
794
794
return True
795
795
796
- def bridge_event_to_hass (mqttc , topicprefix , data ):
796
+ def bridge_event_to_hass (mqttc , topic_prefix , data ):
797
797
"""Translate some rtl_433 sensor data to Home Assistant auto discovery."""
798
798
799
799
if "model" not in data :
@@ -806,7 +806,7 @@ def bridge_event_to_hass(mqttc, topicprefix, data):
806
806
skipped_keys = []
807
807
published_keys = []
808
808
809
- base_topic , device_id = rtl_433_device_info (data )
809
+ base_topic , device_id = rtl_433_device_info (data , topic_prefix )
810
810
if not device_id :
811
811
# no unique device identifier
812
812
logging .warning ("No suitable identifier found for model: " , model )
0 commit comments