Skip to content

KeyError: 'val' on certain payloads #116

Description

@CloCkWeRX

From home-assistant/core#138507
And
home-assistant/core#128046

2025-02-16 13:33:45.581 DEBUG (MainThread) [greeclimate.network] Received packet from 10.0.3.142:
<- {"t": "pack", "i": 0, "uid": 0, "cid": "502cc6a61428", "tcid": "", "pack": {"t": "res", "mac": "502cc6a61428", "r": 200, "opt": ["SetTem", "TemRec", "TemUn"], "p": [17, 0, 0]}}
2025-02-16 13:33:45.581 ERROR (MainThread) [greeclimate.network] Error while handling packet
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/greeclimate/network.py", line 235, in packet_received
    param = params.get(resp, lambda o, a: (o, a))(obj, addr)
  File "/usr/local/lib/python3.13/site-packages/greeclimate/network.py", line 225, in <lambda>
    Response.RESULT.value: lambda o, a: [dict(zip(o["pack"]["opt"], o["pack"]["val"]))],
                                                                    ~~~~~~~~~^^^^^^^
KeyError: 'val'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions