From 9cd69e924999700b91a5fa251b98ae2df3ddad20 Mon Sep 17 00:00:00 2001 From: Mark Atwood Date: Thu, 30 Jan 2025 21:32:24 -0800 Subject: [PATCH] send proper Manufacturer and Model strings to device discovery currently setting device discovery model to "Mfgr-Model" from rtl_433 data and device discovery manufacturer to "rtl_433". Fix to actually set correct model and manufacturer strings. --- examples/rtl_433_mqtt_hass.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/rtl_433_mqtt_hass.py b/examples/rtl_433_mqtt_hass.py index e4b75c55f..0fc091d3b 100755 --- a/examples/rtl_433_mqtt_hass.py +++ b/examples/rtl_433_mqtt_hass.py @@ -954,8 +954,13 @@ def publish_config(mqttc, topic, model, object_id, mapping, key=None): config["state_topic"] = topic config["unique_id"] = object_name config["name"] = readable_name - config["device"] = { "identifiers": [object_id], "name": object_id, "model": model, "manufacturer": "rtl_433" } + try: + hassio_device_mfgr, hassio_device_modl = model.split('-', 1) + config["device"] = { "identifiers": [object_id], "name": object_id, "model": hassio_device_modl, "manufacturer": hassio_device_mfgr } + except ValueError: + config["device"] = { "identifiers": [object_id], "name": object_id, "model": model, "manufacturer": "rtl_433" } + if args.force_update: config["force_update"] = "true"