[Ovmsdev] OvmsMetricVector<string> causing console.log error

Derek Caudwell d.caudwell at gmail.com
Sun Sep 6 18:07:14 HKT 2020


I am trying to resolve the ovms web interface throwing an "undefined" error
because the following metric is defined with OvmsMetricVector<string> and
does not get quoted when parsed to JSON.parse(ev.data) in ovms.js.

Output from console error log:

However, when using
JSON.print(OvmsMetrics.GetValues("xnl.v.c.duration.label")) a properly
formed json string is returned:
  "xnl.v.c.duration.label": [

Can this be corrected at the ev.data source or use JSON.print on ev.data
before parsing it?

Kind regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20200906/959045c4/attachment.html>

More information about the OvmsDev mailing list