More LINTing

Better prototype for `MultiLevelSwitchEntityManager.set_value`
This commit is contained in:
Fabio Manganiello 2023-02-05 23:07:43 +01:00
parent fde834c1b1
commit 419a0cec61
Signed by: blacklight
GPG Key ID: D90FBA7F76362774
4 changed files with 8 additions and 6 deletions

View File

@ -35,7 +35,7 @@ class MultiLevelSwitchEntityManager(EntityManager, ABC):
@abstractmethod @abstractmethod
def set_value( # pylint: disable=redefined-builtin def set_value( # pylint: disable=redefined-builtin
self, *entities, property=None, data=None, **__ self, *_, property=None, data=None, **__
): ):
"""Set a value""" """Set a value"""
raise NotImplementedError() raise NotImplementedError()

View File

@ -859,8 +859,9 @@ class SmartthingsPlugin(
return self.status(device) return self.status(device)
@action @action
def set_value( # pylint: disable=arguments-differ,redefined-builtin # pylint: disable=redefined-builtin,arguments-differ
self, device: str, property: Optional[str] = None, data=None, **kwargs 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 Set the value of a device. It is compatible with the generic

View File

@ -1105,7 +1105,7 @@ class SwitchbotPlugin(
@action @action
# pylint: disable=redefined-builtin,arguments-differ # 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) entity = self._to_entity(device, property)
assert entity, f'No such entity: "{device}"' assert entity, f'No such entity: "{device}"'

View File

@ -1072,8 +1072,9 @@ class ZigbeeMqttPlugin(
return properties return properties
@action @action
def set_value( # pylint: disable=redefined-builtin,arguments-differ # pylint: disable=redefined-builtin,arguments-differ
self, device: str, property: Optional[str] = None, data=None, **kwargs def set_value(
self, device: str, *_, property: Optional[str] = None, data=None, **kwargs
): ):
""" """
Entity-compatible way of setting a value on a node. Entity-compatible way of setting a value on a node.