-
Improvement
-
Resolution: Fixed
-
Major
-
master
AGLBaseService provides default un/subscribe() methods which send a request() to the corresponding service with {'value': 'event-to-be-subscribed-for'} keyword/value style, and the default methods have single string parameter which replaces 'event-to-be-subscribed-for' with the desired event.
However not all agl-services follow this way of subscribing. agl-service-can-low-level .un/subscribe() verbs expect {'event': 'string'} instead of {'value': 'string'} so changing that for convenience, and also may need additional keys 'filter' for example:
service.subscribe({'event': eventname, 'filter': {'min': minspeed, 'max': maxspeed}})
Fix AFBResponse for EVENT data
when passing data to AFBResponse class which in base.py, the constructor does wrong assignment at the end which effectively makes it work only for responses as AFBResponse.data contains the actual payload
EVENT messages emitted by subscriptions do not contain 'response' key and when trying to .get('response'), None is returned.
Add timeout ability to AGLBaseService.listener()
When doing subscription and event testing, there are cases which need to test lack of emitted events,
changing the .listener() async generator to be able to return None when a timeout is specified.