FutureTense / keymaster

Home Assistant integration for managing Z-Wave enabled locks
MIT License
219 stars 43 forks source link

Error setting up second lock #242

Closed dragonsoul84 closed 2 years ago

dragonsoul84 commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

I followed all the instructions to install the Keymaster integration and setup my first lock (garage door). I was able to setup the lovelace config to show me the code options for the first lock. I attempted to repeat the integration setup to add second lock (front door). After inputting the info for my second lock it gave me the confirmation, but showed up under integrations for that lock with an ! mark. I clicked on it to view the error and it displayed the information posted in the log section below. I checked the packages/keymaster folder and it does not contain anything for the second lock (front door). I deleted everything and tried again, but adding the front door first and the garage door second. This time the front door worked and the garage door errored out.

Environment (please complete the following information):

Logs This error originated from a custom integration.

Logger: homeassistant.config_entries Source: custom_components/keymaster/services.py:242 Integration: keymaster (documentation, issues) First occurred: 9:37:06 PM (1 occurrences) Last logged: 9:37:06 PM

Error setting up entry frontdoor for keymaster Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 304, in async_setup result = await component.async_setup_entry(hass, self) # type: ignore File "/config/custom_components/keymaster/init.py", line 288, in async_setup_entry await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1491, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1530, in _execute_service await self._hass.async_add_executor_job(handler.job.target, service_call) File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/keymaster/init.py", line 264, in _generate_package generate_package_files(hass, name) File "/config/custom_components/keymaster/services.py", line 238, in generate_package_files config_entry = next( File "/config/custom_components/keymaster/services.py", line 242, in if hass.data[DOMAIN][entry_id][PRIMARY_LOCK].lock_name == name TypeError: string indices must be integers

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

Additional context Add any other context about the problem here. Please add emails in plain/text format if possible and applicable.

firstof9 commented 2 years ago

Duplicate of #240