From dde7894bb271a3ffa9da40cc01c84d25aea5502c Mon Sep 17 00:00:00 2001 From: Kirmas Date: Mon, 5 Sep 2022 20:17:14 +0300 Subject: [PATCH] unit is optional string fix choices type --- miio/devicestatus.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/miio/devicestatus.py b/miio/devicestatus.py index 9e0babada..694279f4f 100644 --- a/miio/devicestatus.py +++ b/miio/devicestatus.py @@ -2,7 +2,16 @@ import logging import warnings from enum import Enum -from typing import Callable, Dict, Optional, Union, get_args, get_origin, get_type_hints +from typing import ( + Callable, + Dict, + Optional, + Type, + Union, + get_args, + get_origin, + get_type_hints, +) from .descriptors import ( EnumSettingDescriptor, @@ -165,11 +174,11 @@ def setting( *, setter: Optional[Callable] = None, setter_name: Optional[str] = None, - unit: str, + unit: Optional[str] = None, min_value: Optional[int] = None, max_value: Optional[int] = None, step: Optional[int] = None, - choices: Optional[Enum] = None, + choices: Optional[Type[Enum]] = None, choices_attribute: Optional[str] = None, **kwargs, ):