-
Notifications
You must be signed in to change notification settings - Fork 92
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
Failure to initialize database #661
Comments
Correct. You need to remove |
Thanks! That does work. Closing now and here's a minimal example that actually works and receives events: #!/usr/bin/env python3
import asyncio
# There are many different radio libraries but they all have the same API
from bellows.zigbee.application import ControllerApplication
class MainListener:
"""
Contains callbacks that zigpy will call whenever something happens.
Look for `listener_event` in the Zigpy source or just look at the logged warnings.
"""
def __init__(self, application):
self.application = application
def device_joined(self, device):
print(f"Device joined: {device}")
def attribute_updated(self, device, cluster, attribute_id, value):
print(f"Received an attribute update {attribute_id}={value}"
f" on cluster {cluster} from device {device}")
async def main():
app = ControllerApplication({
"database_path": "./zigbee.db",
"device": {
"path": "/dev/ttyUSB0",
}
})
listener = MainListener(app)
app.add_listener(listener)
await app.startup(auto_form=True)
# Just run forever
await asyncio.get_running_loop().create_future()
if __name__ == "__main__":
asyncio.run(main()) |
Thanks for your help |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've tried the following example code to try and get events from my network:
This failed with this error:
I found a similar thing in the zboss library here:
kardia-as/zigpy-zboss#55
So maybe a similar patch is needed to make the database init work:
https://github.com/zigpy/zigpy-znp/pull/250/files
Given that this has happened in multiple places maybe the upstream init function should have this already?
The text was updated successfully, but these errors were encountered: