Skip to content

Commit 9d33f8f

Browse files
committed
Blacken
1 parent 78af4b1 commit 9d33f8f

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

modbus4mqtt/modbus4mqtt.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def _set_mqtt_connection_status(self, status: MqttConnectionStatus):
317317
def _on_message(self, client, userdata, msg):
318318
# print("got a message: {}: {}".format(msg.topic, msg.payload))
319319
# TODO Handle json_key writes. https://github.com/tjhowse/modbus4mqtt/issues/23
320-
topic = msg.topic[len(self.prefix):]
320+
topic = msg.topic[len(self.prefix) :]
321321
for register in [
322322
register for register in self.registers if "set_topic" in register
323323
]:
@@ -431,7 +431,11 @@ def _load_modbus_config(self, path: str) -> dict:
431431
except FileNotFoundError:
432432
# Try to load the config from the pre-1.0.0 location. I.E. replace "config" with "modbus4mqtt"
433433
alt_path = path.replace("config", "modbus4mqtt")
434-
logging.warning("Failed to find config file on path: {}. Checking alternative path {}".format(path, alt_path))
434+
logging.warning(
435+
"Failed to find config file on path: {}. Checking alternative path {}".format(
436+
path, alt_path
437+
)
438+
)
435439
result = yaml.load(open(alt_path, "r").read())
436440
registers = [
437441
register for register in result["registers"] if "pub_topic" in register

0 commit comments

Comments
 (0)