Fix compile issues on windows (#3491)

This commit is contained in:
Jesse Hills 2022-05-19 21:21:42 +12:00 committed by GitHub
parent dda1ddcb26
commit d9d2edeb08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View file

@ -41,7 +41,6 @@
* O FF FF FF FF FF FF FF FF - Not used
* M 6C - CRC over bytes 2 to F (Addition)
\*********************************************************************************************/
#include <cmath>
#include "sonoff_d1.h"
namespace esphome {
@ -263,7 +262,7 @@ void SonoffD1Output::write_state(light::LightState *state) {
state->current_values_as_brightness(&brightness);
// Convert ESPHome's brightness (0-1) to the device's internal brightness (0-100)
const uint8_t calculated_brightness = std::round(brightness * 100);
const uint8_t calculated_brightness = (uint8_t) roundf(brightness * 100);
if (calculated_brightness == 0) {
// if(binary) ESP_LOGD(TAG, "current_values_as_binary() returns true for zero brightness");

View file

@ -20,7 +20,7 @@ void TuyaTextSensor::setup() {
break;
}
default:
ESP_LOGW(TAG, "Unsupported data type for tuya text sensor %u: %#02hhX", datapoint.id, datapoint.type);
ESP_LOGW(TAG, "Unsupported data type for tuya text sensor %u: %#02hhX", datapoint.id, (uint8_t) datapoint.type);
break;
}
});