|
|
@@ -485,7 +485,7 @@ class TuyaDpsConfig:
|
|
|
# Insert signed interpretation here
|
|
|
if self._config.get("mask_signed", False):
|
|
|
# Count how many bits are set in the mask
|
|
|
- bit_count = bin(mask).count("1")
|
|
|
+ bit_count = mask.bit_count()
|
|
|
raw_result = to_signed(raw_result, bit_count)
|
|
|
|
|
|
return self._map_from_dps(raw_result, device)
|