Merge branch 'master' into light_scenes

This commit is contained in:
ultratoto14
2020-11-15 19:41:06 +01:00
committed by GitHub

View File

@@ -62,7 +62,7 @@ class LocaltuyaSensor(LocalTuyaEntity):
"""Device status was updated."""
state = self.dps(self._dp_id)
scale_factor = self._config.get(CONF_SCALING)
if scale_factor is not None:
if scale_factor is not None and isinstance(state, (int, float)):
state = round(state * scale_factor, DEFAULT_PRECISION)
self._state = state