[Ovmsdev] Notifications Framework (subtype and filtering)
Mark Webb-Johnson
mark at webb-johnson.net
Wed May 9 09:33:27 HKT 2018
I’ve extended the notifications framework to include the concept of notification subtypes. This is in addition to the existing notification base types.
This allows us to automatically filter notifications based on the granular subtypes. The filtering is done at the framework level, so all notification listeners need to do is turn it on (when they register).
I have identified the following standard subtypes, and updated quite a few modules to use them:
charge.stopped
charge.state
batt.alert
batt.12v (seems similar to batt.alert, but not yet decided)
homelink
debug.crash
xks.aux
xrt.battmon
xrt.power
xrt.gps
xrt.trip
xrt.sevcon
xrt.logs
xrt.reset
I would really rather have all the alert types standardised (including things like trip logs, gps tracking, etc) and working across all vehicle types. But this at least is a starting point.
An example of it working is:
OVMS# notify raise text info test hello
Raise text notification for info/test as hello
I (25618) ovms-server-v2: Send MP-0 PIhello
OVMS# config set notify test none
Parameter has been set.
OVMS# notify raise text info test hello
Raise text notification for info/test as hello
OVMS# config set notify test ovmsv2
Parameter has been set.
OVMS# notify raise text info test hello
Raise text notification for info/test as hello
I (71368) ovms-server-v2: Send MP-0 PIhello
I am working on the vehicle module automated alerts we previously discussed, and this is a pre-requisite. New standardised subtypes will come with that (such as charge.start, charge.done, etc).
Regards, Mark.
> Begin forwarded message:
>
> From: GitHub <noreply at github.com>
> Subject: [openvehicles/Open-Vehicle-Monitoring-System-3] 7516c9: test framework commands for testing can bus tx/rx
> Date: 9 May 2018 at 9:18:53 AM HKT
> To: mark at webb-johnson.net
> Reply-To: GitHub <noreply at github.com>
>
> Branch: refs/heads/master
> Home: https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3
> Commit: 7516c9681055ec7986a94ccb8cfb29bda5f1bce8
> https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/commit/7516c9681055ec7986a94ccb8cfb29bda5f1bce8
> Author: Mark Webb-Johnson <mark at webb-johnson.net>
> Date: 2018-05-09 (Wed, 09 May 2018)
>
> Changed paths:
> M vehicle/OVMS.V3/main/test_framework.cpp
>
> Log Message:
> -----------
> test framework commands for testing can bus tx/rx
>
>
> Commit: 183d26dc107bb21cd956776228d0a24030b115db
> https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/commit/183d26dc107bb21cd956776228d0a24030b115db
> Author: Mark Webb-Johnson <mark at webb-johnson.net>
> Date: 2018-05-09 (Wed, 09 May 2018)
>
> Changed paths:
> M vehicle/OVMS.V3/components/ovms_server_v2/src/ovms_server_v2.cpp
> M vehicle/OVMS.V3/components/ovms_server_v3/src/ovms_server_v3.cpp
> M vehicle/OVMS.V3/components/vehicle/vehicle.cpp
> M vehicle/OVMS.V3/components/vehicle_kiasoulev/src/vehicle_kiasoulev.cpp
> M vehicle/OVMS.V3/components/vehicle_renaulttwizy/src/rt_battmon.cpp
> M vehicle/OVMS.V3/components/vehicle_renaulttwizy/src/rt_notify.cpp
> M vehicle/OVMS.V3/components/vehicle_renaulttwizy/src/rt_sevcon.cpp
> M vehicle/OVMS.V3/components/vehicle_renaulttwizy/src/rt_sevcon_faults.cpp
> M vehicle/OVMS.V3/components/vehicle_renaulttwizy/src/vehicle_renaulttwizy.cpp
> M vehicle/OVMS.V3/main/ovms_boot.cpp
> M vehicle/OVMS.V3/main/ovms_notify.cpp
> M vehicle/OVMS.V3/main/ovms_notify.h
>
> Log Message:
> -----------
> Notifications: Framework extensions to add support for subtypes on notifications, and automatic filtering by subtype and distribution mechanism
>
>
> Compare: https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/compare/57d8f1b449d6...183d26dc107b
> **NOTE:** This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/
>
> Functionality will be removed from GitHub.com on January 31st, 2019.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20180509/acd1f340/attachment-0001.html>
More information about the OvmsDev
mailing list