Skip to content

Commit 4462651

Browse files
authored
Support DeviceInfo.model_id (#595)
1 parent 753b2c3 commit 4462651

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

hacs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Shellies Discovery",
3-
"homeassistant": "2024.1.0b0",
3+
"homeassistant": "2024.9.0b0",
44
"zip_release": true,
55
"filename": "shellies-discovery.zip"
66
}

python_scripts/shellies_discovery.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""This script adds MQTT discovery support for Shellies devices."""
22

3-
VERSION = "5.1.0"
3+
VERSION = "5.2.0"
44

55
ATTR_ICON = "icon"
66
ATTR_MANUFACTURER = "Allterco Robotics"
@@ -157,6 +157,7 @@
157157
KEY_MODE_STATE_TEMPLATE = "mode_stat_tpl"
158158
KEY_MODE_STATE_TOPIC = "mode_stat_t"
159159
KEY_MODEL = "mdl"
160+
KEY_MODEL_ID = "mdl_id"
160161
KEY_MODES = "modes"
161162
KEY_NAME = "name"
162163
KEY_OFF_DELAY = "off_dly"
@@ -2431,8 +2432,9 @@ def mqtt_publish(topic, payload, retain, json=False):
24312432
KEY_CONNECTIONS: [[KEY_MAC, format_mac(mac)]],
24322433
KEY_NAME: device_name,
24332434
KEY_MODEL: model,
2435+
KEY_MODEL_ID: model_id,
24342436
KEY_SW_VERSION: fw_ver,
2435-
KEY_HW_VERSION: f"gen1 ({model_id})",
2437+
KEY_HW_VERSION: "gen1",
24362438
KEY_MANUFACTURER: ATTR_MANUFACTURER,
24372439
KEY_CONFIGURATION_URL: f"http://{host}/",
24382440
}

0 commit comments

Comments
 (0)