Skip to content

Commit

Permalink
send proper Manufacturer and Model strings to device discovery
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fallenpegasus authored Jan 31, 2025
1 parent da6974e commit 9cd69e9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/rtl_433_mqtt_hass.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 9cd69e9

Please sign in to comment.