nimi-python
nimi-python copied to clipboard
Add mechanism to allow subscribing to Driver Warning events
- [x] This contribution adheres to CONTRIBUTING.md.
- [x] I've updated CHANGELOG.md if applicable.
- [x] I've added tests applicable for this pull request
What does this Pull Request accomplish?
- Allows users to subscribe to driver warning events by defining and passing a callback function
- This would be alongside the warnings.warn mechanism already available
- Users can choose to take any action through the callback function for given a driver's warning, without having to override any global warning handlers
- Subscription should be done per driver, in a given application, allowing flexibility to take different actions for different drivers
- If there are no subscriptions, then warning event will not be triggered and driver warning response would just be based on warnings.warn configuration
List issues fixed by this Pull Request below, if any.
- Fix #2088
What testing has been done?
- Ensured that callback functions are called into, in the event of a driver warning with appropriate warning details(DriverWarning object)
- Unit tests have been added to validate the same