Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xiaomi Aqara Gateway: IndexError (list index out of range) fixed #12858

Merged
merged 1 commit into from Mar 3, 2018

Conversation

syssi
Copy link
Member

@syssi syssi commented Mar 3, 2018

#12814 cannot work:

>>> try:
...   print(SENSOR_TYPES.get("lux")[1])
... except TypeError:
...   print("none")
...
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
IndexError: list index out of range

@Danielhiversen
Copy link
Member

Do we then need the except TypeError: ?

@syssi
Copy link
Member Author

syssi commented Mar 3, 2018

If we introduce new sensor types without extending the list.

SENSOR_TYPES.get("new_sensor_type")[0] -> None
SENSOR_TYPES.get("new_sensor_type")[1] -> None

@balloob balloob merged commit 7d8a309 into home-assistant:dev Mar 3, 2018
@thijsdejong thijsdejong mentioned this pull request Mar 3, 2018
2 tasks
@balloob balloob mentioned this pull request Mar 9, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Jul 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants