mirror of
https://github.com/esphome/esphome.git
synced 2024-11-30 13:04:13 +01:00
Fix compile issues on windows (#3491)
This commit is contained in:
parent
dda1ddcb26
commit
d9d2edeb08
@ -41,7 +41,6 @@
|
|||||||
* O FF FF FF FF FF FF FF FF - Not used
|
* O FF FF FF FF FF FF FF FF - Not used
|
||||||
* M 6C - CRC over bytes 2 to F (Addition)
|
* M 6C - CRC over bytes 2 to F (Addition)
|
||||||
\*********************************************************************************************/
|
\*********************************************************************************************/
|
||||||
#include <cmath>
|
|
||||||
#include "sonoff_d1.h"
|
#include "sonoff_d1.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
@ -263,7 +262,7 @@ void SonoffD1Output::write_state(light::LightState *state) {
|
|||||||
state->current_values_as_brightness(&brightness);
|
state->current_values_as_brightness(&brightness);
|
||||||
|
|
||||||
// Convert ESPHome's brightness (0-1) to the device's internal brightness (0-100)
|
// 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 (calculated_brightness == 0) {
|
||||||
// if(binary) ESP_LOGD(TAG, "current_values_as_binary() returns true for zero brightness");
|
// if(binary) ESP_LOGD(TAG, "current_values_as_binary() returns true for zero brightness");
|
||||||
|
@ -20,7 +20,7 @@ void TuyaTextSensor::setup() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
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;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user