From 82dbf607c19fcd0b3b85882b936afa67b6334e95 Mon Sep 17 00:00:00 2001 From: Aaron Godfrey Date: Sun, 30 Jun 2019 22:32:48 -0700 Subject: [PATCH] Removed length for BitValue namedtuples. --- tests/test_client.py | 12 ++++++------ wideq/client.py | 7 +------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index 0e219c5..5d10eb0 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -90,12 +90,12 @@ class ModelInfoTest(unittest.TestCase): def test_value_bit(self): actual = self.model_info.value('Option1') expected = BitValue({ - 0: {'length': 1, 'value': 'ChildLock'}, - 1: {'length': 1, 'value': 'ReduceStatic'}, - 2: {'length': 1, 'value': 'EasyIron'}, - 3: {'length': 1, 'value': 'DampDrySingal'}, - 4: {'length': 1, 'value': 'WrinkleCare'}, - 7: {'length': 1, 'value': 'AntiBacterial'}, + 0: 'ChildLock', + 1: 'ReduceStatic', + 2: 'EasyIron', + 3: 'DampDrySingal', + 4: 'WrinkleCare', + 7: 'AntiBacterial', }) self.assertEqual(expected, actual) diff --git a/wideq/client.py b/wideq/client.py index 2751588..4b1be67 100644 --- a/wideq/client.py +++ b/wideq/client.py @@ -323,12 +323,7 @@ class ModelInfo(object): d['option'].get('step', 1) ) elif d['type'].lower() == 'bit': - bit_values = { - opt['startbit']: { - 'length': opt['length'], - 'value': opt['value'], - } for opt in d['option'] - } + bit_values = {opt['startbit']: opt['value'] for opt in d['option']} return BitValue(bit_values) elif d['type'].lower() == 'reference': return ReferenceValue(d['option'][0])