Skip to content

Commit

Permalink
Make unit optional for @setting, fix type hint for choices (#1519)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirmas authored Sep 6, 2022
1 parent 207a053 commit d544083
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions miio/devicestatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
):
Expand Down

0 comments on commit d544083

Please sign in to comment.