From e7c4fe7ee943f868421452be4d797c01cb0bf767 Mon Sep 17 00:00:00 2001 From: Ray Thomson Date: Sat, 6 Mar 2021 21:15:00 +1100 Subject: [PATCH] Fix type period_ms --- src/adafruit_blinka/microcontroller/rockchip/PWMOut.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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): -- 2.49.0