Label sensors with hex address

This commit is contained in:
m-hume 2020-06-03 13:06:01 +01:00 committed by GitHub
parent 7e8c1368a8
commit 3748bb2121
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -78,10 +78,10 @@ void MCP9808Show(bool json) {
char temperature[33]; char temperature[33];
dtostrfd(mcp9808_sensors[i].temperature, Settings.flag2.temperature_resolution, temperature); 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)); strlcpy(sensor_name, mcp9808_cfg.types, sizeof(sensor_name));
if (mcp9808_cfg.count > 1) { 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) { if (json) {