33
33
_sequence_number = 0 # pylint: disable=invalid-name
34
34
35
35
36
- def broadcast (measurement : 'AdafruitSensorMeasurement' , * , broadcast_time : float = 0.1 , extended : bool = False ) -> None :
36
+ def broadcast (
37
+ measurement : "AdafruitSensorMeasurement" ,
38
+ * ,
39
+ broadcast_time : float = 0.1 ,
40
+ extended : bool = False
41
+ ) -> None :
37
42
"""Broadcasts the given measurement for the given broadcast time. If extended is False and the
38
43
measurement would be too long, it will be split into multiple measurements for transmission,
39
44
each with the given broadcast time.
@@ -156,7 +161,9 @@ class AdafruitSensorMeasurement(Advertisement):
156
161
"""Battery voltage in millivolts. Saves two bytes over voltage and is more readable in bare
157
162
packets."""
158
163
159
- def __init__ (self , * , entry : Optional [ScanEntry ] = None , sequence_number : int = 0 ) -> None :
164
+ def __init__ (
165
+ self , * , entry : Optional [ScanEntry ] = None , sequence_number : int = 0
166
+ ) -> None :
160
167
super ().__init__ (entry = entry )
161
168
if entry :
162
169
return
@@ -172,7 +179,7 @@ def __str__(self) -> str:
172
179
parts .append ("{}={}" .format (attr , str (value )))
173
180
return "<{} {} >" .format (self .__class__ .__name__ , " " .join (parts ))
174
181
175
- def split (self , max_packet_size : int = 31 ) -> ' AdafruitSensorMeasurement' :
182
+ def split (self , max_packet_size : int = 31 ) -> " AdafruitSensorMeasurement" :
176
183
"""Split the measurement into multiple measurements with the given max_packet_size. Yields
177
184
each submeasurement."""
178
185
current_size = 8 # baseline for mfg data and sequence number
0 commit comments