blob: 6b6dc667bc13f9aceadecc080c340f353bd90046 [file] [log] [blame]
Vic Yangebd6de62012-06-26 14:25:57 +08001# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5class FAFTClientAttribute(object):
6 """Class that tests platform name and gives client machine attributes."""
7 version = 1
8
Vic Yangf78c65f2012-07-20 16:32:20 +08009 DEFAULT_SETTING = {'keyboard_dev': True,
10 'chrome_ec': False,
11 'ec_capability': list()}
Vic Yangebd6de62012-06-26 14:25:57 +080012
13 def __init__(self, platform):
14 """Initialized.
15
16 Args:
17 platform: Platform name returned by FAFT client.
18 """
19 self.__dict__.update(self.DEFAULT_SETTING)
20 self.__dict__.update(self._get_platform_setting(platform))
21
22
23 def _get_platform_setting(self, platform):
24 """Return platform-specific settings."""
25 setting = dict()
26
27 if platform in ['Aebl', 'Alex', 'Kaen', 'Lumpy', 'Mario', 'Seaboard',
28 'Stumpy', 'ZGB']:
29 setting['keyboard_dev'] = False
30
Vic Yangf78c65f2012-07-20 16:32:20 +080031 if platform in ['Link', 'Snow']:
32 setting['chrome_ec'] = True
33
34 if platform == 'Link':
35 setting['ec_capability'] = ['adc_ectemp', 'battery', 'charging',
36 'keyboard', 'lid', 'x86', 'thermal',
Vic Yang4d72cb62012-07-24 11:51:09 +080037 'usb', 'peci']
Vic Yangf78c65f2012-07-20 16:32:20 +080038 elif platform == 'Snow':
39 setting['ec_capability'] = ['battery', 'charging', 'keyboard',
40 'lid', 'arm']
41
Vic Yangebd6de62012-06-26 14:25:57 +080042 return setting