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

This commit is contained in:
2025-06-05 17:02:00 -04:00
parent a42ed54f38
commit af42a5971e

View File

@ -774,7 +774,7 @@ func (v *Vehicle) getRemoteOptionsStatus() bool {
// parseDoor . // parseDoor .
func (v *Vehicle) parseParts(name string, value any) { func (v *Vehicle) parseParts(name string, value any) {
// re := regexp.MustCompile(`[A-Z][^A-Z]*`) // re := regexp.MustCompile(`[A-Z][^A-Z]*`)
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)?`) 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) grps := re.FindStringSubmatch(name)
pn := grps[1] + "_" + grps[2] pn := grps[1] + "_" + grps[2]