co2: round to first decimal place

This commit is contained in:
Sebastian Lohff 2021-01-11 01:47:54 +01:00
parent 3a086962c0
commit 25b13553c7
1 changed files with 2 additions and 2 deletions

View File

@ -134,12 +134,12 @@ class CO2Meter(Sensor):
def get_temp(self): def get_temp(self):
if 0x42 in self.values: if 0x42 in self.values:
return self.values[0x42] / 16.0 - 273.15 return round(self.values[0x42] / 16.0 - 273.15, 1)
return None return None
def get_humidity(self): def get_humidity(self):
if 0x44 in self.values: if 0x44 in self.values:
return self.values[0x44] / 100.0 return round(self.values[0x44] / 100.0, 1)
return None return None
def get_data(self): def get_data(self):