From 419a0cec611dd5a8f7e5b9732655e7cbb63dff11 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 5 Feb 2023 23:07:43 +0100 Subject: [PATCH] More LINTing Better prototype for `MultiLevelSwitchEntityManager.set_value` --- platypush/entities/_managers/switches.py | 2 +- platypush/plugins/smartthings/__init__.py | 5 +++-- platypush/plugins/switchbot/__init__.py | 2 +- platypush/plugins/zigbee/mqtt/__init__.py | 5 +++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/platypush/entities/_managers/switches.py b/platypush/entities/_managers/switches.py index ce00c3149..cd78d13da 100644 --- a/platypush/entities/_managers/switches.py +++ b/platypush/entities/_managers/switches.py @@ -35,7 +35,7 @@ class MultiLevelSwitchEntityManager(EntityManager, ABC): @abstractmethod def set_value( # pylint: disable=redefined-builtin - self, *entities, property=None, data=None, **__ + self, *_, property=None, data=None, **__ ): """Set a value""" raise NotImplementedError() diff --git a/platypush/plugins/smartthings/__init__.py b/platypush/plugins/smartthings/__init__.py index 21346d6f4..3c7dd867e 100644 --- a/platypush/plugins/smartthings/__init__.py +++ b/platypush/plugins/smartthings/__init__.py @@ -859,8 +859,9 @@ class SmartthingsPlugin( return self.status(device) @action - def set_value( # pylint: disable=arguments-differ,redefined-builtin - self, device: str, property: Optional[str] = None, data=None, **kwargs + # pylint: disable=redefined-builtin,arguments-differ + def set_value( + self, device: str, *_, property: Optional[str] = None, data=None, **kwargs ): """ Set the value of a device. It is compatible with the generic diff --git a/platypush/plugins/switchbot/__init__.py b/platypush/plugins/switchbot/__init__.py index d907614ec..54ad171c5 100644 --- a/platypush/plugins/switchbot/__init__.py +++ b/platypush/plugins/switchbot/__init__.py @@ -1105,7 +1105,7 @@ class SwitchbotPlugin( @action # pylint: disable=redefined-builtin,arguments-differ - def set_value(self, device: str, property=None, data=None, **__): + def set_value(self, device: str, *_, property=None, data=None, **__): entity = self._to_entity(device, property) assert entity, f'No such entity: "{device}"' diff --git a/platypush/plugins/zigbee/mqtt/__init__.py b/platypush/plugins/zigbee/mqtt/__init__.py index f8cca0ec3..2094cde13 100644 --- a/platypush/plugins/zigbee/mqtt/__init__.py +++ b/platypush/plugins/zigbee/mqtt/__init__.py @@ -1072,8 +1072,9 @@ class ZigbeeMqttPlugin( return properties @action - def set_value( # pylint: disable=redefined-builtin,arguments-differ - self, device: str, property: Optional[str] = None, data=None, **kwargs + # pylint: disable=redefined-builtin,arguments-differ + def set_value( + self, device: str, *_, property: Optional[str] = None, data=None, **kwargs ): """ Entity-compatible way of setting a value on a node.