Fix fragile substring dispatch in TcTask.recv()
Replace 'Soll' in key / 'Temp' in subkey substring loops with direct dict key presence checks, matching the message structure used in send. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tqxrk8uj4M3w3d3eXm3xK8
This commit is contained in:
+4
-6
@@ -35,15 +35,13 @@ class TcTask(ATask):
|
||||
asyncio.create_task(self.send({'Enabled': value}))
|
||||
|
||||
async def recv(self, msg):
|
||||
for key in msg.keys():
|
||||
if 'Soll' in key:
|
||||
if 'Soll' in msg:
|
||||
submsg = msg['Soll']
|
||||
for subkey in submsg.keys():
|
||||
if 'Temp' in subkey:
|
||||
if 'Temp' in submsg:
|
||||
self.tc.set_theta_soll(submsg['Temp'])
|
||||
if 'Rate' in subkey:
|
||||
if 'Rate' in submsg:
|
||||
self.tc.set_heatrate_soll(submsg['Rate'])
|
||||
if 'Enable' in key:
|
||||
if 'Enable' in msg:
|
||||
self.tc.set_enabled(bool(msg['Enable']))
|
||||
|
||||
async def send(self, data):
|
||||
|
||||
Reference in New Issue
Block a user