@@ -64,16 +64,16 @@ def is_valid_bssid(bssid) -> bool:
64
64
return False
65
65
66
66
@staticmethod
67
- def is_valid_uint_value (value , max_size = 64 ):
67
+ def is_valid_uint_value (value , bit_count = 64 ):
68
68
"""
69
- Checks if 'value' is a non-negative integer fitting into 'max_size ' bits.
70
- For example, max_size =32 => must fit within 0 <= value <= 0xFFFFFFFF
69
+ Checks if 'value' is a non-negative integer fitting into 'bit_count ' bits.
70
+ For example, bit_count =32 => must fit within 0 <= value <= 0xFFFFFFFF
71
71
"""
72
72
if not isinstance (value , int ):
73
73
return False
74
74
if value < 0 :
75
75
return False
76
- return value < 2 ** max_size
76
+ return value < 2 ** bit_count
77
77
78
78
def assert_valid_bssid (self , value , field_name ):
79
79
"""Asserts that the value is a valid BSSID (MAC address), None, or NullValue."""
@@ -88,22 +88,22 @@ def assert_valid_bssid(self, value, field_name):
88
88
89
89
def assert_valid_uint64 (self , value , field_name ):
90
90
"""Asserts that the value is a valid uint64 or None (if attribute can return NULL)."""
91
- asserts .assert_true (value is None or self .is_valid_uint_value (value , max_size = 64 ),
91
+ asserts .assert_true (value is None or self .is_valid_uint_value (value , bit_count = 64 ),
92
92
f"{ field_name } should be a uint64 or NULL." )
93
93
94
94
def assert_valid_uint32 (self , value , field_name ):
95
95
"""Asserts that the value is a valid uint32 or None (if attribute can return NULL)."""
96
- asserts .assert_true (value is None or self .is_valid_uint_value (value , max_size = 32 ),
96
+ asserts .assert_true (value is None or self .is_valid_uint_value (value , bit_count = 32 ),
97
97
f"{ field_name } should be a uint32 or NULL." )
98
98
99
99
def assert_valid_uint16 (self , value , field_name ):
100
100
"""Asserts that the value is a valid uint16 or None (if attribute can return NULL)."""
101
- asserts .assert_true (value is None or self .is_valid_uint_value (value , max_size = 16 ),
101
+ asserts .assert_true (value is None or self .is_valid_uint_value (value , bit_count = 16 ),
102
102
f"{ field_name } should be a uint16 or NULL." )
103
103
104
104
def assert_valid_uint8 (self , value , field_name ):
105
105
"""Asserts that the value is a valid uint16 or None (if attribute can return NULL)."""
106
- asserts .assert_true (value is None or self .is_valid_uint_value (value , max_size = 8 ),
106
+ asserts .assert_true (value is None or self .is_valid_uint_value (value , bit_count = 8 ),
107
107
f"{ field_name } should be a uint8 or NULL." )
108
108
109
109
async def read_dgwifi_attribute_expect_success (self , endpoint , attribute ):
0 commit comments