Andre0512 / hon

Home Assistant integration for Haier hOn: support for Haier/Candy/Hoover home appliances like washing machines and air conditioners in 28 languages.
MIT License
1.3k stars 2.46k forks source link

Integration fails to reload after adding Hoover H-Dish 500 #134

Open the-jameen opened 12 months ago

the-jameen commented 12 months ago

Describe the bug Having used hon integration for some time with my washing machine and tumbledryer, I recently purchased a Hoover H-dish 500 dishwasher. As soon as I added this device to the hOn app and reloaded the HA integration, it produced an error.

To Reproduce Steps to reproduce the behavior:

  1. Add H-Dish 500 Dishwasher to hOn app
  2. Reload integration within HA
  3. HA integrations shows "failed to set-up"
  4. Removing Dishwasher from hOn app and then reloading HA integration fixes issue

Expected behavior Integration works with HA integration

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Additional context

Home Assistant Logs

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/hon/init.py", line 32, in async_setup_entry hon = await Hon( ^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyhon/hon.py", line 66, in create await self.setup() File "/usr/local/lib/python3.11/site-packages/pyhon/hon.py", line 104, in setup await self._create_appliance(appliance, self.api) File "/usr/local/lib/python3.11/site-packages/pyhon/hon.py", line 84, in _create_appliance await asyncio.gather( File "/usr/local/lib/python3.11/site-packages/pyhon/appliance.py", line 180, in load_commands await command_loader.load_commands() File "/usr/local/lib/python3.11/site-packages/pyhon/command_loader.py", line 60, in load_commands self._get_commands() File "/usr/local/lib/python3.11/site-packages/pyhon/command_loader.py", line 101, in _get_commands if command := self._parse_command(data, name): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyhon/command_loader.py", line 124, in _parse_command if category := self._parse_categories(data, command_name): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyhon/command_loader.py", line 134, in _parse_categories if command := self._parse_command( ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyhon/command_loader.py", line 117, in _parse_command return HonCommand( ^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyhon/commands.py", line 40, in init self._load_parameters(attributes) File "/usr/local/lib/python3.11/site-packages/pyhon/commands.py", line 94, in _load_parameters for name, data in items.items(): ^^^^^^^^^^^ AttributeError: 'str' object has no attribute 'items'

the-jameen commented 10 months ago

Thanks @Andre0512, integration appears to load successfully now