@@ -152,8 +152,7 @@ def __str__(self):
152
152
lut_keys .sort ()
153
153
for temp in lut_keys :
154
154
fan_drive = self .lut_values [temp ]
155
- value_strs .append ("%d deg C => %.1f%% duty cycle" %
156
- (temp , fan_drive ))
155
+ value_strs .append ("%d deg C => %.1f%% duty cycle" % (temp , fan_drive ))
157
156
158
157
return "\n " .join (value_strs )
159
158
@@ -176,8 +175,7 @@ def _set_lut(self, lut_dict):
176
175
# Verify that the value is a correct amount
177
176
lut_value = lut_dict [k ]
178
177
if lut_value > 100.0 or lut_value < 0 :
179
- raise AttributeError (
180
- "LUT values must be a fan speed from 0-100%" )
178
+ raise AttributeError ("LUT values must be a fan speed from 0-100%" )
181
179
182
180
# add the current temp/speed to our internal representation
183
181
self .lut_values [k ] = lut_value
@@ -192,20 +190,16 @@ def _set_lut(self, lut_dict):
192
190
for idx in range (lut_size ):
193
191
current_temp = lut_keys [idx ]
194
192
current_speed = _speed_to_lsb (self .lut_values [current_temp ])
195
- getattr (self , "_fan_lut_t%d" %
196
- (idx + 1 )).__set__ (self , current_temp )
197
- getattr (self , "_fan_lut_s%d" %
198
- (idx + 1 )).__set__ (self , current_speed )
193
+ getattr (self , "_fan_lut_t%d" % (idx + 1 )).__set__ (self , current_temp )
194
+ getattr (self , "_fan_lut_s%d" % (idx + 1 )).__set__ (self , current_speed )
199
195
200
196
# self.emc_fan._lut_temp_setters[idx].__set__(self.emc_fan, current_temp)
201
197
# self.emc_fan._lut_speed_setters[idx].__set__(self.emc_fan, current_speed)
202
198
203
199
# Set the remaining LUT entries to the default (Temp/Speed = max value)
204
200
for idx in range (8 )[lut_size :]:
205
- getattr (self , "_fan_lut_t%d" %
206
- (idx + 1 )).__set__ (self , MAX_LUT_TEMP )
207
- getattr (self , "_fan_lut_s%d" %
208
- (idx + 1 )).__set__ (self , MAX_LUT_SPEED )
201
+ getattr (self , "_fan_lut_t%d" % (idx + 1 )).__set__ (self , MAX_LUT_TEMP )
202
+ getattr (self , "_fan_lut_s%d" % (idx + 1 )).__set__ (self , MAX_LUT_SPEED )
209
203
self .emc_fan .lut_enabled = current_mode
210
204
211
205
@@ -284,7 +278,7 @@ class SpinupTime(CV):
284
278
285
279
class EMC2101 : # pylint: disable=too-many-instance-attributes
286
280
"""Driver for the EMC2101 Fan Controller.
287
- :param ~busio.I2C i2c_bus: The I2C bus the EMC is connected to.
281
+ :param ~busio.I2C i2c_bus: The I2C bus the EMC is connected to.
288
282
"""
289
283
290
284
_part_id = ROUnaryStruct (_REG_PARTID , "<B" )
@@ -372,19 +366,19 @@ def external_temperature(self):
372
366
373
367
def set_pwm_clock (self , use_preset = False , use_slow = False ):
374
368
"""
375
- Select the PWM clock source, chosing between two preset clocks or by configuring the
376
- clock using `pwm_frequency` and `pwm_frequency_divisor`.
377
-
378
- :param bool use_preset:
379
- True: Select between two preset clock sources
380
- False: The PWM clock is set by `pwm_frequency` and `pwm_frequency_divisor`
381
- :param bool use_slow:
382
- True: Use the 1.4kHz clock
383
- False: Use the 360kHz clock.
384
- :type priority: integer or None
385
- :return: None
386
- :raises AttributeError: if use_preset is not a `bool`
387
- :raises AttributeError: if use_slow is not a `bool`
369
+ Select the PWM clock source, chosing between two preset clocks or by configuring the
370
+ clock using `pwm_frequency` and `pwm_frequency_divisor`.
371
+
372
+ :param bool use_preset:
373
+ True: Select between two preset clock sources
374
+ False: The PWM clock is set by `pwm_frequency` and `pwm_frequency_divisor`
375
+ :param bool use_slow:
376
+ True: Use the 1.4kHz clock
377
+ False: Use the 360kHz clock.
378
+ :type priority: integer or None
379
+ :return: None
380
+ :raises AttributeError: if use_preset is not a `bool`
381
+ :raises AttributeError: if use_slow is not a `bool`
388
382
389
383
"""
390
384
@@ -450,7 +444,7 @@ def manual_fan_speed(self, fan_speed):
450
444
@property
451
445
def lut_enabled (self ):
452
446
"""Enable or disable the internal look up table used to map a given temperature
453
- to a fan speed. When the LUT is disabled, fan speed can be changed with `manual_fan_speed`"""
447
+ to a fan speed. When the LUT is disabled fan speed can be changed with `manual_fan_speed`"""
454
448
return not self ._fan_lut_prog
455
449
456
450
@lut_enabled .setter
0 commit comments