Merge branch 'master' into light_scenes
This commit is contained in:
@@ -62,7 +62,7 @@ class LocaltuyaSensor(LocalTuyaEntity):
|
|||||||
"""Device status was updated."""
|
"""Device status was updated."""
|
||||||
state = self.dps(self._dp_id)
|
state = self.dps(self._dp_id)
|
||||||
scale_factor = self._config.get(CONF_SCALING)
|
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)
|
state = round(state * scale_factor, DEFAULT_PRECISION)
|
||||||
self._state = state
|
self._state = state
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user