mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-10 16:05:26 +00:00
add Temperature_div100 for BMP280
This commit is contained in:
@ -418,6 +418,26 @@ int http_fn_index(http_request_t* request) {
|
||||
hprintf255(request, "Temperature Channel %s value %.2f C<br>", CHANNEL_GetLabel(i), fValue);
|
||||
poststr(request, "</td></tr>");
|
||||
|
||||
}
|
||||
else if (channelType == ChType_Pressure_div100) {
|
||||
|
||||
iValue = CHANNEL_Get(i);
|
||||
fValue = iValue * 0.01f;
|
||||
|
||||
poststr(request, "<tr><td>");
|
||||
hprintf255(request, "Pressure Channel %s value %.2f hPa<br>", CHANNEL_GetLabel(i), fValue);
|
||||
poststr(request, "</td></tr>");
|
||||
|
||||
}
|
||||
else if (channelType == ChType_Temperature_div100) {
|
||||
|
||||
iValue = CHANNEL_Get(i);
|
||||
fValue = iValue * 0.01f;
|
||||
|
||||
poststr(request, "<tr><td>");
|
||||
hprintf255(request, "Temperature Channel %s value %.2f C<br>", CHANNEL_GetLabel(i), fValue);
|
||||
poststr(request, "</td></tr>");
|
||||
|
||||
}
|
||||
else if (channelType == ChType_Humidity) {
|
||||
|
||||
@ -2038,6 +2058,15 @@ void doHomeAssistantDiscovery(const char* topic, http_request_t* request) {
|
||||
discoveryQueued = true;
|
||||
}
|
||||
break;
|
||||
case ChType_Temperature_div100:
|
||||
{
|
||||
dev_info = hass_init_sensor_device_info(TEMPERATURE_SENSOR, i, 2, 2, 1);
|
||||
MQTT_QueuePublish(topic, dev_info->channel, hass_build_discovery_json(dev_info), OBK_PUBLISH_FLAG_RETAIN);
|
||||
hass_free_device_info(dev_info);
|
||||
|
||||
discoveryQueued = true;
|
||||
}
|
||||
break;
|
||||
case ChType_Humidity:
|
||||
{
|
||||
dev_info = hass_init_sensor_device_info(HUMIDITY_SENSOR, i, -1, -1, 1);
|
||||
|
||||
Reference in New Issue
Block a user