Skip to content

Commit

Permalink
Simplify helper decorators to accept name as non-kwarg (#1499)
Browse files Browse the repository at this point in the history
  • Loading branch information
rytilahti committed Aug 14, 2022
1 parent cf90f2c commit d9672f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions miio/devicestatus.py
Expand Up @@ -73,7 +73,7 @@ def switches(self) -> Dict[str, SwitchDescriptor]:
return self._switches # type: ignore[attr-defined]


def sensor(*, name: str, unit: str = "", **kwargs):
def sensor(name: str, *, unit: str = "", **kwargs):
"""Syntactic sugar to create SensorDescriptor objects.
The information can be used by users of the library to programatically find out what
Expand Down Expand Up @@ -113,7 +113,7 @@ def _sensor_type_for_return_type(func):
return decorator_sensor


def switch(*, name: str, setter_name: str, **kwargs):
def switch(name: str, *, setter_name: str, **kwargs):
"""Syntactic sugar to create SwitchDescriptor objects.
The information can be used by users of the library to programatically find out what
Expand Down

0 comments on commit d9672f2

Please sign in to comment.