From: Ray Thomson Date: Sat, 6 Mar 2021 10:15:00 +0000 (+1100) Subject: Fix type period_ms X-Git-Tag: 6.4.0^2~5 X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/commitdiff_plain/e7c4fe7ee943f868421452be4d797c01cb0bf767 Fix type period_ms --- diff --git a/src/adafruit_blinka/microcontroller/rockchip/PWMOut.py b/src/adafruit_blinka/microcontroller/rockchip/PWMOut.py index f2509f4..abff5d1 100644 --- a/src/adafruit_blinka/microcontroller/rockchip/PWMOut.py +++ b/src/adafruit_blinka/microcontroller/rockchip/PWMOut.py @@ -178,8 +178,8 @@ class PWMOut: return self.period_us / 1000 def _set_period_ms(self, period_ms): - if not isinstance(period_ms, int): - raise TypeError("Invalid period type, should be int.") + if not isinstance(period_ms, (int, float)): + raise TypeError("Invalid period type, should be int or float.") self.period_us = int(period_ms * 1000) period_ms = property(_get_period_ms, _set_period_ms) @@ -189,7 +189,7 @@ class PWMOut: PWMError: if an I/O or OS error occurs. TypeError: if value type is not int. - :type: int + :type: int, float """ def _get_period_us(self):