teleshoes/tpacpi-bat — pull request #27 by linrunner (2013-09-20 20:58:39+00:00)
Title: getASLBase(): match $dmiVersion with regex

If you reorder and group the currently known models by families and
hardware generations a pattern appears:

'ThinkPad E420s' => '\_SB.PCI0.LPCB.EC0.HKEY',

'ThinkPad Edge E335' => '\_SB.PCI0.LPC0.EC0.HKEY',

'ThinkPad Edge E430' => '\_SB.PCI0.LPCB.EC0.HKEY',
'ThinkPad Edge E431' => '\_SB.PCI0.LPCB.EC0.HKEY',
'ThinkPad Edge E530' => '\_SB.PCI0.LPCB.EC0.HKEY',

'ThinkPad L430' => '\_SB.PCI0.LPCB.H_EC.HKEY',
'ThinkPad L530' => '\_SB.PCI0.LPCB.H_EC.HKEY',

'ThinkPad S420' => '\_SB.PCI0.LPCB.EC0.HKEY',

'ThinkPad S430' => '\_SB.PCI0.LPCB.EC0.HKEY',
'ThinkPad Edge S430' => '\_SB.PCI0.LPCB.EC0.HKEY',
'ThinkPad S431' => '\_SB.PCI0.LPCB.EC0.HKEY',
'ThinkPad S3-S431' => '\_SB.PCI0.LPCB.EC0.HKEY',

'ThinkPad T430u' => '\_SB.PCI0.LPCB.EC.HKEY',

'ThinkPad X121e' => '\_SB.PCI0.LPCB.EC.HKEY',

With some guesswork about the upcoming *4? generation one can
combine the pattern into just a few regular expressions.

I think this may reduce the number of issues to add single models
significantly.