mirror of https://github.com/arendst/Tasmota.git
Label sensors with hex address
This commit is contained in:
parent
7e8c1368a8
commit
3748bb2121
|
@ -78,10 +78,10 @@ void MCP9808Show(bool json) {
|
|||
char temperature[33];
|
||||
dtostrfd(mcp9808_sensors[i].temperature, Settings.flag2.temperature_resolution, temperature);
|
||||
|
||||
char sensor_name[10];
|
||||
char sensor_name[11];
|
||||
strlcpy(sensor_name, mcp9808_cfg.types, sizeof(sensor_name));
|
||||
if (mcp9808_cfg.count > 1) {
|
||||
snprintf_P(sensor_name, sizeof(sensor_name), PSTR("%s%c%d"), sensor_name, IndexSeparator(), i +1); // MCP9808-1
|
||||
snprintf_P(sensor_name, sizeof(sensor_name), PSTR("%s%c%02X"), sensor_name, IndexSeparator(), mcp9808_sensors[i].address); // MCP9808-18, MCP9808-1A etc.
|
||||
}
|
||||
|
||||
if (json) {
|
||||
|
@ -133,4 +133,4 @@ bool Xsns72(uint8_t function)
|
|||
}
|
||||
|
||||
#endif // USE_MCP9808
|
||||
#endif // USE_I2C
|
||||
#endif // USE_I2C
|
||||
|
|
Loading…
Reference in New Issue