diff --git a/custom_components/localtuya/sensor.py b/custom_components/localtuya/sensor.py index f1ed21e..bd73814 100644 --- a/custom_components/localtuya/sensor.py +++ b/custom_components/localtuya/sensor.py @@ -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