From d8df4cb19fdfee2680fa6f03e058e0f190c2e226 Mon Sep 17 00:00:00 2001 From: matteo porta Date: Wed, 13 Jul 2022 11:11:32 +0200 Subject: [PATCH] wip --- src/components/tecna_marposs_provaset_t3.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/tecna_marposs_provaset_t3.py b/src/components/tecna_marposs_provaset_t3.py index b5dbb08..665b9cf 100644 --- a/src/components/tecna_marposs_provaset_t3.py +++ b/src/components/tecna_marposs_provaset_t3.py @@ -78,9 +78,7 @@ class TecnaMarpossProvasetT3(ModbusComponent): ["MEASURE UNITS: Flow rate measure units", self._flow_units_map, ["flo"]], ]: v = self.read(register) - unit = v & 0xff - decimals = (v >> 8) & 0xff - unit_spec = [10**(-decimals), unit_map.get(unit, unit)] + unit_spec = [10**(-((v >> 8) & 0xff)), unit_map[v & 0xff]] for unit_name in unit_names: units[unit_name] = unit_spec return units