Fix illuminance encoding in ble, BTHome v2

This commit is contained in:
rbaron 2022-12-04 10:13:01 +01:00
parent cc62786d16
commit 381bbb7ceb

View file

@ -108,9 +108,9 @@ int prst_ble_encode_service_data(const prst_sensors_t* sensors,
out[8] = humi_val >> 8; out[8] = humi_val >> 8;
// Illuminance. // Illuminance.
out[9] = 0x05; out[9] = 0x05;
out[10] = sensors->photo.brightness >> 16; out[10] = sensors->photo.brightness & 0xff;
out[11] = (sensors->photo.brightness >> 8) & 0xff; out[11] = sensors->photo.brightness >> 8;
out[12] = sensors->photo.brightness & 0xff; out[12] = 0;
// Battery voltage. // Battery voltage.
out[13] = 0x0c; out[13] = 0x0c;
// Value. Factor of 0.001. // Value. Factor of 0.001.