Since it is now possible that we replace a value without a mapping, we need to ensure that replaced is set even when there is no mapping. Discussion #2080
@@ -661,6 +661,7 @@ class TuyaDpsConfig:
result = val
scale = self.scale(device)
+ replaced = False
mapping = self._find_map_for_dps(val)
if mapping: