h4de5 / home-assistant-toshiba_ac

Toshiba AC integration into home-assistant.io
GNU General Public License v3.0
113 stars 17 forks source link

Home Assistant 2023.8.0 - Error adding entities for domain switch #135

Closed chrisandsally closed 11 months ago

chrisandsally commented 11 months ago

Sorry folks, Error when updated to 2023.8.0

Logger: homeassistant.components.switch Source: helpers/entity_platform.py:619 Integration: Switch (documentation, issues) First occurred: 21:47:58 (2 occurrences) Last logged: 21:47:58

Error adding entities for domain switch with platform toshiba_ac Error while setting up toshiba_ac platform for switch Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 619, in _async_add_entity device = dev_reg.async_get(self.hass).async_get_or_create( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: DeviceRegistry.async_get_or_create() got an unexpected keyword argument 'account'

KaSroka commented 11 months ago

Seems like here we have a field named account, which shouldn't be present. There is no such a filed in current version of this data structure.

h4de5 commented 11 months ago

mmh. mapping it to model would be misleading - and as it seems it is not showing up anyways, should we just drop it?

h4de5 commented 11 months ago

have a look and thanks for the analysis!

Nounoux0183 commented 11 months ago

Hello, Same problem for me following the HA update, Toshiba AC control is no longer functional. Too bad, because I made a number of automations with them. Thank you h4de5 for this great work. Hoping to find the use of this superb integration.

vermi0ffh commented 11 months ago

I tried to remove the line with the account field. It was not enough, now I have a problem with the device_id field. Looks like it's not here anymore, but not sure if I can delete it too. Maybe it's replaced with the identifiers field ?

wally-mageia commented 11 months ago

With the fix https://github.com/h4de5/home-assistant-toshiba_ac/commit/3ad3e597ff07f19f94e8c6293a1139c4961274cd applied I get 4 pcs of errors. toshiba_ac platform for XXX is different in each log entry.

Source: helpers/entity_platform.py:619
Integration: Climate (documentation, issues)
First occurred: 15:02:59 (2 occurrences)
Last logged: 15:02:59

Error adding entities for domain climate with platform toshiba_ac
Error while setting up toshiba_ac platform for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 619, in _async_add_entity
    device = dev_reg.async_get(self.hass).async_get_or_create(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: DeviceRegistry.async_get_or_create() got an unexpected keyword argument 'device_id'
chrisandsally commented 11 months ago

Just upgraded to 2023.8.1 to see if it was a bug in the .0 release but still same error.

vermi0ffh commented 11 months ago

I tried to remove the line "device_id=self._device.device_id," too, and it works !

wally-mageia commented 11 months ago

I tried to remove the line "device_id=self._device.device_id," too, and it works !

Yes, same here. Works again after removing also the device_id line.

h4de5 commented 11 months ago

thanks everyone for testing.

anto294 commented 11 months ago

Same! Removed account and device_id line in entity.py. Now works again in 2023.8.0 - 2023.8.1

olej24 commented 11 months ago

hi I’ve deleted the line from the code but am still getting the below error and the sensors are still unavailable. I’m on 2023.8.1

IMG_0958

chrisandsally commented 11 months ago

Thanks and tested on your push from HACS, all good. Thank you so much folks!

olej24 commented 11 months ago

hi I’ve deleted the line from the code but am still getting the below error and the sensors are still unavailable. I’m on 2023.8.1

IMG_0958

Updated via HACS and now working. Thank you for the quick fix

juscode commented 11 months ago

Thanks for fixing