core icon indicating copy to clipboard operation
core copied to clipboard

Error in Gree Climate integration

Open hccallisen opened this issue 1 year ago • 2 comments

The problem

I get this issue on an regular basis: Logger: greeclimate.network Källa: /usr/local/lib/python3.12/site-packages/greeclimate/network.py:240 Inträffade först: 20:20:24 (1 händelser) Senast loggade: 20:20:24

Error while handling packet Traceback (most recent call last): File "/usr/local/lib/python3.12/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.12/site-packages/greeclimate/network.py", line 225, in Response.RESULT.value: lambda o, a: [dict(zip(o["pack"]["opt"], o["pack"]["val"]))], ~~~~~~~~~^^^^^^^ KeyError: 'val'

What version of Home Assistant Core has the issue?

core-2024.9.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

gree

Link to integration documentation on our website

No response

Diagnostics information

Logger: greeclimate.network Källa: /usr/local/lib/python3.12/site-packages/greeclimate/network.py:240 Inträffade först: 20:20:24 (1 händelser) Senast loggade: 20:20:24

Error while handling packet Traceback (most recent call last): File "/usr/local/lib/python3.12/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.12/site-packages/greeclimate/network.py", line 225, in Response.RESULT.value: lambda o, a: [dict(zip(o["pack"]["opt"], o["pack"]["val"]))], ~~~~~~~~~^^^^^^^ KeyError: 'val'

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

hccallisen avatar Sep 30 '24 20:09 hccallisen

Hey there @cmroche, mind taking a look at this issue as it has been labeled with an integration (gree) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of gree can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign gree Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


gree documentation gree source (message by IssueLinks)

home-assistant[bot] avatar Oct 01 '24 10:10 home-assistant[bot]

Ok. I have no idea what im doing, however, can someone else maybe check if this is correct and if so what do we do next???

I changed line 225 in /usr/local/lib/python3.12/site-packages/greeclimate/network.py from Response.RESULT.value: lambda o, a: [dict(zip(o["pack"]["opt"], o["pack"]["val"]))],

to

Response.RESULT.value: lambda o, a: [dict(zip(o["pack"]["opt"], o["pack"].get("val", o["pack"].get("p", []))))], The errors have now gone in the logs and the units are updating without using the refresh intergration hack.

anyone able to verifiy?

bradleewright avatar Oct 13 '24 12:10 bradleewright

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.