mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-05 22:35:57 +00:00
fix potential RSSI name collision
This commit is contained in:
@ -86,7 +86,13 @@ void hass_populate_unique_id(ENTITY_TYPE type, int index, char* uniq_id) {
|
||||
case CURRENT_SENSOR:
|
||||
sprintf(uniq_id, "%s_%s_%d", longDeviceName, "current", index);
|
||||
break;
|
||||
case HASS_RSSI:
|
||||
sprintf(uniq_id, "%s_rssi", longDeviceName);
|
||||
break;
|
||||
default:
|
||||
// TODO: USE type here as well?
|
||||
// If type is not set, and we use "sensor" naming, we can easily make collision
|
||||
//sprintf(uniq_id, "%s_%s_%d_%d", longDeviceName, "sensor", (int)type, index);
|
||||
sprintf(uniq_id, "%s_%s_%d", longDeviceName, "sensor", index);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -63,10 +63,11 @@ typedef enum {
|
||||
READONLYLOWMIDHIGH_SENSOR,
|
||||
// lx unit
|
||||
ILLUMINANCE_SENSOR,
|
||||
// dBm unit
|
||||
HASS_RSSI,
|
||||
|
||||
ENERGY_SENSOR,
|
||||
|
||||
HASS_RSSI,
|
||||
} ENTITY_TYPE;
|
||||
|
||||
//unique_id is defined in hass_populate_unique_id and is based on CFG_GetDeviceName() whose size is CGF_DEVICE_NAME_SIZE.
|
||||
|
||||
Reference in New Issue
Block a user