remove unneeded exception handling

This commit is contained in:
Stefan Allius
2025-05-18 16:54:34 +02:00
parent 2e9d16b611
commit dc360f31d6

View File

@@ -203,7 +203,6 @@ class Mqtt(metaclass=Singleton):
def dcu_cmd(self, message): def dcu_cmd(self, message):
payload = message.payload.decode("UTF-8") payload = message.payload.decode("UTF-8")
try:
val = round(float(payload) * 10) val = round(float(payload) * 10)
if val < 1000 or val > 8000: if val < 1000 or val > 8000:
logger_mqtt.error('dcu_power: value must be in' logger_mqtt.error('dcu_power: value must be in'
@@ -213,5 +212,3 @@ class Mqtt(metaclass=Singleton):
pdu = struct.pack('>BBBBBBH', 1, 1, 6, 1, 0, 1, val) pdu = struct.pack('>BBBBBBH', 1, 1, 6, 1, 0, 1, val)
for fnc in self.each_inverter(message, "send_dcu_cmd"): for fnc in self.each_inverter(message, "send_dcu_cmd"):
fnc(pdu) fnc(pdu)
except Exception:
pass