Optimize the last light update logic to ensure that switching fast update mode does not cause a delay in the update. (Thanks to rob_sm7219for for the feedback)

This commit is contained in:
sen 2023-08-28 17:47:43 +08:00
parent 71b88d18f9
commit 8072db6e39

View File

@ -442,6 +442,7 @@ sensor:
return {}; return {};
} }
if (id(bh1750_fast_update).state){ if (id(bh1750_fast_update).state){
id(last_illuminance) = x;
return x; return x;
} }
if (abs(id(last_illuminance) - x) > 1){ if (abs(id(last_illuminance) - x) > 1){