@@ -152,8 +152,7 @@ def __str__(self):
152152 lut_keys .sort ()
153153 for temp in lut_keys :
154154 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 ))
157156
158157 return "\n " .join (value_strs )
159158
@@ -176,8 +175,7 @@ def _set_lut(self, lut_dict):
176175 # Verify that the value is a correct amount
177176 lut_value = lut_dict [k ]
178177 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%" )
181179
182180 # add the current temp/speed to our internal representation
183181 self .lut_values [k ] = lut_value
@@ -192,20 +190,16 @@ def _set_lut(self, lut_dict):
192190 for idx in range (lut_size ):
193191 current_temp = lut_keys [idx ]
194192 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 )
199195
200196 # self.emc_fan._lut_temp_setters[idx].__set__(self.emc_fan, current_temp)
201197 # self.emc_fan._lut_speed_setters[idx].__set__(self.emc_fan, current_speed)
202198
203199 # Set the remaining LUT entries to the default (Temp/Speed = max value)
204200 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 )
209203 self .emc_fan .lut_enabled = current_mode
210204
211205
@@ -284,7 +278,7 @@ class SpinupTime(CV):
284278
285279class EMC2101 : # pylint: disable=too-many-instance-attributes
286280 """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.
288282 """
289283
290284 _part_id = ROUnaryStruct (_REG_PARTID , "<B" )
@@ -372,19 +366,19 @@ def external_temperature(self):
372366
373367 def set_pwm_clock (self , use_preset = False , use_slow = False ):
374368 """
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`
388382
389383 """
390384
@@ -450,7 +444,7 @@ def manual_fan_speed(self, fan_speed):
450444 @property
451445 def lut_enabled (self ):
452446 """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`"""
454448 return not self ._fan_lut_prog
455449
456450 @lut_enabled .setter
0 commit comments