Fixed parts parsing regexp
All checks were successful
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Successful in 22s
All checks were successful
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Successful in 22s
This commit is contained in:
@ -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]
|
||||||
|
Reference in New Issue
Block a user