Просмотр исходного кода

fix (time): ensure time components are integers

Some devices may represent values as enum type, which comes through as a string
Ensure proper conversion of values.

Discussion #3565
Jason Rumney 4 месяцев назад
Родитель
Сommit
2b8aaa6396
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      custom_components/tuya_local/time.py

+ 1 - 1
custom_components/tuya_local/time.py

@@ -70,7 +70,7 @@ class TuyaLocalTime(TuyaLocalEntity, TimeEntity):
         hours = hours or 0
         minutes = minutes or 0
         seconds = seconds or 0
-        delta = timedelta(hours=hours, minutes=minutes, seconds=seconds)
+        delta = timedelta(hours=int(hours), minutes=int(minutes), seconds=int(seconds))
         return (MIDNIGHT + delta).time()
 
     async def async_set_value(self, value: time):