Changed the way of parsing parts
All checks were successful
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Successful in 22s

This commit is contained in:
2025-06-05 14:14:33 -04:00
parent 91c3c44b54
commit 57e0e7899d

View File

@ -795,10 +795,11 @@ func (v *Vehicle) parseParts(name string, value any) {
re := regexp.MustCompile(`([Dd]oor|[Ww]indow|[Tt]ire)(?:[Pp]ressure)?([Ff]ront|[Rr]ear|[Bb]oot|[Ee]ngine[Hh]ood|[Ss]unroof)([Ll]eft|[Rr]ight)?(?:[Pp]osition|[Ss]tatus|[Ll]ock[Ss]tatus|[Pp]si)?`)
grps := re.FindStringSubmatch(name)
pn := strings.ToLower(grps[1] + "_" + grps[2])
if len(grps[2]) > 0 {
pn := grps[1] + "_" + grps[2]
if len(grps[3]) > 0 {
pn = pn + "_" + grps[3]
}
pn = strings.ToLower(pn)
// v.client.logger.Debug("VEHICLE COND", "key", name, "value", value, "number", len(submatchall))
switch grps[1] {