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

Add storage helper to ZHA and use it for the device node descriptor #21500

Merged
merged 8 commits into from
Mar 4, 2019

Conversation

dmulcahey
Copy link
Contributor

This PR adds storage to ZHA and leverages it for storing the zigbee node descriptor so that we have the device specific power profile and the manufacturer code available for us to use. Eventually it will house the group id's and tables for multicast transmissions (real zigbee light groups) and the neighbor and rousing tables that we can use for network visualization among other things.

@balloob looking for your feedback on the storage usage if you don't mind... want to make sure I did this correctly.

Copy link
Member

@balloob balloob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks fine

@dmulcahey dmulcahey force-pushed the dm/zha-node-power-descriptors branch 2 times, most recently from 438dda5 to fc5cf60 Compare March 1, 2019 00:45
@dmulcahey
Copy link
Contributor Author

@balloob are we good when the build passes?

@dmulcahey dmulcahey requested a review from balloob March 2, 2019 14:25
add info to device info

disable pylint rule

check for success
@dmulcahey dmulcahey force-pushed the dm/zha-node-power-descriptors branch from fc5cf60 to c7c7fec Compare March 3, 2019 00:47
@balloob balloob merged commit fc07d3a into home-assistant:dev Mar 4, 2019
@ghost ghost removed the in progress label Mar 4, 2019
@balloob balloob mentioned this pull request Mar 20, 2019
@dmulcahey dmulcahey deleted the dm/zha-node-power-descriptors branch May 8, 2019 10:58
@ckpt-martin
Copy link

ckpt-martin commented Jun 26, 2019

Hi @dmulcahey,
Since the addition of the storage helper my ZigBee USB stick no longer works with ZHA. It works fine up to 0.89.2. But as soon as I upgrade to any 0.9x release Zigbee stops working with an error related to store.py. It looks like it is having an issue accessing or storing the power_source and manufacturer code of my stick.
I use the Bitronvideo AV2010/10 (http://bvsite.smabit.eu/index.php/produkte/smart-home-produkte/zb-funkstick/ - site is in German bit the specs are there).
This is the error that HA throws when starting:

2019-06-25 15:54:38 INFO (MainThread) [homeassistant.setup] Setting up zha
2019-06-25 15:54:38 INFO (MainThread) [homeassistant.setup] Setup of domain zha took 0.0 seconds.
2019-06-25 15:54:38 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry /dev/ttyUSB0 for zha
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/config_entries.py", line 302, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/zha/__init__.py", line 150, in async_setup_entry
    zha_storage = await async_get_registry(hass)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/zha/core/store.py", line 160, in async_get_registry
    return cast(ZhaDeviceStorage, await task)
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/zha/core/store.py", line 155, in _load_reg
    await registry.async_load()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/zha/core/store.py", line 112, in async_load
    power_source=device['power_source'],
KeyError: 'power_source'

I have went back to HA 0.89.2 where everything works. But I would like to upgrade HA at some point. Would be nice we could fix this. Thanks.

@MartinHjelmare
Copy link
Member

Please open an issue if you suspect a bug.

If you want to suggest an enhancement please open a feature request in the Feature Requests section of our community forum.

Merged PRs should not be used for enhancement discussion or bug reports. If you've found a bug it's ok to make a review with inline comments and link to an issue that reports the bug.

Thanks!

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Jun 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants