Skip to content

Commit 2e742d0

Browse files
minot: Send proper Manufacturer and Model strings to hassio mqtt device discovery (#3174)
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.
1 parent 02612b9 commit 2e742d0

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

examples/rtl_433_mqtt_hass.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,8 +965,13 @@ def publish_config(mqttc, topic, model, object_id, mapping, key=None):
965965
config["state_topic"] = topic
966966
config["unique_id"] = object_name
967967
config["name"] = readable_name
968-
config["device"] = { "identifiers": [object_id], "name": object_id, "model": model, "manufacturer": "rtl_433" }
969968

969+
try:
970+
hassio_device_mfgr, hassio_device_modl = model.split('-', 1)
971+
config["device"] = { "identifiers": [object_id], "name": object_id, "model": hassio_device_modl, "manufacturer": hassio_device_mfgr }
972+
except ValueError:
973+
config["device"] = { "identifiers": [object_id], "name": object_id, "model": model, "manufacturer": "rtl_433" }
974+
970975
if args.force_update:
971976
config["force_update"] = "true"
972977

0 commit comments

Comments
 (0)