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

Handle UserAlerts and ManufacturerSpecificDBReady notifications #208

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nickrbogdanov
Copy link

On installations where the /etc/openzwave device configuration database is missing files, the Python wrapper can generate these unhelpful errors:

2021-04-09 09:01:26,267 notif_callback : new notification
2021-04-09 09:01:26,268 notif_callback : Notification type : 30, nodeId : 0
2021-04-09 09:01:26,268 notif_callback exception
Traceback (most recent call last):
  File "src-lib/libopenzwave/libopenzwave.pyx", line 512, in libopenzwave.notif_callback
IndexError: list index out of range
UnboundLocalError: local variable 'n' referenced before assignment
Exception ignored in: 'libopenzwave.notif_callback'
UnboundLocalError: local variable 'n' referenced before assignment
2021-04-09 09:01:26,269 notif_callback : new notification
2021-04-09 09:01:26,269 notif_callback : Notification type : 30, nodeId : 0
2021-04-09 09:01:26,269 notif_callback exception
Traceback (most recent call last):
  File "src-lib/libopenzwave/libopenzwave.pyx", line 512, in libopenzwave.notif_callback
IndexError: list index out of range

They correspond to these messages in the C++ library's log:

2021-04-09 09:10:23.476 Warning, Config Revision of ManufacturerSpecific Database is out of date
2021-04-09 09:10:23.476 Info, Queuing download for http://download.db.openzwave.com/mfs.xml
2021-04-09 09:10:23.477 Warning, File Removal failed: /etc/openzwave/manufacturer_specific.xml
2021-04-09 09:10:23.477 Warning, File Transfer Failed. Could not Rotate Existing File: /etc/openzwave/manufacturer_specific.xml
2021-04-09 09:10:23.477 Warning, Can't download ManufacturerSpecifix.xml Config file
2021-04-09 09:10:23.477 Info, ManufacturerSpecificDB Initialized
2021-04-09 09:10:23.477 Detail, Notification: User Alert - Manufacturer_specific.xml out of Date
2021-04-09 09:10:23.478 Detail, Notification: A Config File Failed to download
2021-04-09 09:10:23.478 Detail, Notification: ManufacturerSpecificDB Ready

Update the Python wrapper to handle the notifications properly instead of generating IndexError exceptions.

On installations where the /etc/openzwave device configuration database
is missing files, the Python wrapper can generate these unhelpful errors:

    2021-04-09 09:01:26,267 notif_callback : new notification
    2021-04-09 09:01:26,268 notif_callback : Notification type : 30, nodeId : 0
    2021-04-09 09:01:26,268 notif_callback exception
    Traceback (most recent call last):
      File "src-lib/libopenzwave/libopenzwave.pyx", line 512, in libopenzwave.notif_callback
    IndexError: list index out of range
    UnboundLocalError: local variable 'n' referenced before assignment
    Exception ignored in: 'libopenzwave.notif_callback'
    UnboundLocalError: local variable 'n' referenced before assignment
    2021-04-09 09:01:26,269 notif_callback : new notification
    2021-04-09 09:01:26,269 notif_callback : Notification type : 30, nodeId : 0
    2021-04-09 09:01:26,269 notif_callback exception
    Traceback (most recent call last):
      File "src-lib/libopenzwave/libopenzwave.pyx", line 512, in libopenzwave.notif_callback
    IndexError: list index out of range

They correspond to these messages in the C++ library's log:

    2021-04-09 09:10:23.476 Warning, Config Revision of ManufacturerSpecific Database is out of date
    2021-04-09 09:10:23.476 Info, Queuing download for http://download.db.openzwave.com/mfs.xml
    2021-04-09 09:10:23.477 Warning, File Removal failed: /etc/openzwave/manufacturer_specific.xml
    2021-04-09 09:10:23.477 Warning, File Transfer Failed. Could not Rotate Existing File: /etc/openzwave/manufacturer_specific.xml
    2021-04-09 09:10:23.477 Warning, Can't download ManufacturerSpecifix.xml Config file
    2021-04-09 09:10:23.477 Info, ManufacturerSpecificDB Initialized
    2021-04-09 09:10:23.477 Detail, Notification: User Alert - Manufacturer_specific.xml out of Date
    2021-04-09 09:10:23.478 Detail, Notification: A Config File Failed to download
    2021-04-09 09:10:23.478 Detail, Notification: ManufacturerSpecificDB Ready

Update the Python wrapper to handle the notifications properly instead
of generating IndexError exceptions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant