Normalize air quality
Needed at startup or it will throw wild values.
This commit is contained in:
parent
499c21e329
commit
88822caf26
@ -524,7 +524,11 @@ sensor:
|
|||||||
gas_ratio = 1.0;
|
gas_ratio = 1.0;
|
||||||
}
|
}
|
||||||
float air_quality = gas_ratio * 100;
|
float air_quality = gas_ratio * 100;
|
||||||
return (int)air_quality;
|
int normalized_air_quality = (int)air_quality;
|
||||||
|
if (normalized_air_quality > 100) {
|
||||||
|
normalized_air_quality = 100;
|
||||||
|
}
|
||||||
|
return normalized_air_quality;
|
||||||
|
|
||||||
- platform: tsl2591
|
- platform: tsl2591
|
||||||
address: 0x29
|
address: 0x29
|
||||||
|
Loading…
x
Reference in New Issue
Block a user