Add config flow step user to dsmr (#50318)

Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
Rob Bierbooms 2021-06-24 10:16:08 +02:00 committed by GitHub
parent 0714ee68eb
commit aa56a21b45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 490 additions and 9 deletions

View file

@ -344,7 +344,9 @@ class DSMREntity(SensorEntity):
return self.translate_tariff(value, self._config[CONF_DSMR_VERSION])
with suppress(TypeError):
value = round(float(value), self._config[CONF_PRECISION])
value = round(
float(value), self._config.get(CONF_PRECISION, DEFAULT_PRECISION)
)
if value is not None:
return value