Remove CONF_PRECISION remainder from dsmr (#104919)

This commit is contained in:
Jan Bouwhuis 2023-12-03 11:53:09 +01:00 committed by GitHub
parent edb52bb364
commit 5d6791e412
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 3 additions and 27 deletions

View file

@ -46,7 +46,6 @@ from homeassistant.util import Throttle
from .const import (
CONF_DSMR_VERSION,
CONF_PRECISION,
CONF_PROTOCOL,
CONF_SERIAL_ID,
CONF_SERIAL_ID_GAS,
@ -790,9 +789,7 @@ class DSMREntity(SensorEntity):
return self.translate_tariff(value, self._entry.data[CONF_DSMR_VERSION])
with suppress(TypeError):
value = round(
float(value), self._entry.data.get(CONF_PRECISION, DEFAULT_PRECISION)
)
value = round(float(value), DEFAULT_PRECISION)
# Make sure we do not return a zero value for an energy sensor
if not value and self.state_class == SensorStateClass.TOTAL_INCREASING: