LINT warning fixes

This commit is contained in:
Fabio Manganiello 2022-01-23 14:25:00 +01:00
parent c534adf31f
commit e4eb12fa6d
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774
2 changed files with 6 additions and 7 deletions

View file

@ -1,3 +1,4 @@
import threading
import time
from platypush.backend import Backend
@ -174,7 +175,7 @@ class SensorBackend(Backend):
if plugin and hasattr(plugin, 'close'):
plugin.close()
def process_data(self, data, new_data):
def process_data(self, new_data):
if new_data is not None and new_data not in ({}, []):
self.bus.post(SensorDataChangeEvent(data=new_data, source=self.plugin or self.__class__.__name__))
@ -186,7 +187,7 @@ class SensorBackend(Backend):
try:
data = self.get_measurement()
new_data = self.get_new_data(data)
self.process_data(data, new_data)
self.process_data(new_data)
data_below_threshold = {}
data_above_threshold = {}

View file

@ -14,7 +14,7 @@ class RedisBus(Bus):
""" Overrides the in-process in-memory local bus with a Redis bus """
_DEFAULT_REDIS_QUEUE = 'platypush/bus'
def __init__(self, on_message=None, redis_queue=None, *args, **kwargs):
def __init__(self, *args, on_message=None, redis_queue=None, **kwargs):
super().__init__(on_message=on_message)
if not args and not kwargs:
@ -26,7 +26,7 @@ class RedisBus(Bus):
self.on_message = on_message
self.thread_id = threading.get_ident()
def get(self, parse: bool = True):
def get(self):
""" Reads one message from the Redis queue """
try:
if self.should_stop():
@ -37,9 +37,7 @@ class RedisBus(Bus):
return
msg = msg[1].decode('utf-8')
if parse:
return Message.build(msg)
return msg
except Exception as e:
logger.exception(e)