diff --git a/esphome/components/sonoff_d1/sonoff_d1.cpp b/esphome/components/sonoff_d1/sonoff_d1.cpp index b4bcbc6760..d07f9229b6 100644 --- a/esphome/components/sonoff_d1/sonoff_d1.cpp +++ b/esphome/components/sonoff_d1/sonoff_d1.cpp @@ -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 #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"); diff --git a/esphome/components/tuya/text_sensor/tuya_text_sensor.cpp b/esphome/components/tuya/text_sensor/tuya_text_sensor.cpp index 0b51ba90c4..602595e89d 100644 --- a/esphome/components/tuya/text_sensor/tuya_text_sensor.cpp +++ b/esphome/components/tuya/text_sensor/tuya_text_sensor.cpp @@ -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; } });