mdeweerd / zha-toolkit

🧰 Zigbee Home Assistant Toolkit - service for "rare" Zigbee operations using ZHA on Home Assistant
GNU General Public License v3.0
171 stars 17 forks source link

Error: async_get() takes 1 positional argument but 2 were given #229

Open wbyoung opened 1 month ago

wbyoung commented 1 month ago

I'm getting this new error for a zha_toolkit.attr_read after updating from 2024.5.5 to 2024.6.0.

Chreece commented 1 month ago

I'm getting this from the following service:

service: zha_toolkit.attr_read
data:
  ieee: |
    {{ states.lock
          | rejectattr('state', 'in', ['unavailable', 'unknown', None])
          | selectattr('entity_id', 'in', area_entities('Eingang'))
          | map(attribute='entity_id')
          | first }}
  cluster: 257
  tries: 3
  attribute: 0
AlexW75 commented 1 month ago

Same Problem here as well. Problem started direcly after the update to 2024.6.0 before it worked.

service: zha_toolkit.attr_read
data:
  ieee: light.licht_mobil_01
  endpoint: 1
  cluster: 1
  attribute: 33

Logger: homeassistant.components.automation.auto_mobile_light_03_workaround_battery_status Quelle: helpers/script.py:526 Integration: Automatisierung (Dokumentation, Probleme) Erstmals aufgetreten: 6. Juni 2024 um 21:00:00 (16 Vorkommnisse) Zuletzt protokolliert: 12:00:00

Auto_Mobile_Light_03_Workaround_Battery_Status: Error executing script. Unexpected error for call_service at pos 1: async_get() takes 1 positional argument but 2 were given Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 763, in _async_call_service_step response_data = await self._async_run_long_action( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 726, in _async_run_long_action return await long_task ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2741, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2784, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/zha_toolkit/init.py", line 725, in toolkit_service ieee = await u.get_ieee(app, zha_gw, ieee_str) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/zha_toolkit/utils.py", line 286, in get_ieee else get_hass(listener).helpers.entity_registry.async_get( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: async_get() takes 1 positional argument but 2 were given

eilandert commented 1 month ago

yes, same here, after update.

flohav commented 1 month ago

Hi, I've got the same issue after 2024.6 HA update.

eilandert commented 1 month ago

I reverted back to 2024.5.5 and it worked yet again :-)

DerekF35 commented 1 month ago

here is a commit for ble_monitor that addressed the issue in that codebase.

https://github.com/custom-components/ble_monitor/commit/a95ae14a2146ff6db009ef428e8aeb5733c47238

DerekF35 commented 1 month ago

I don't have much experience with coding for home assistant, but changes found in https://github.com/mdeweerd/zha-toolkit/pull/231 are working for my system on 2024.6.1

benniju commented 3 weeks ago

I don't have much experience with coding for home assistant, but changes found in #231 are working for my system on 2024.6.1 Yep, your PR also seems to have fixed the issue for me

eilandert commented 1 day ago

@mdeweerd can this be merged?