OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import telemetry.core.platform.power_monitor as power_monitor | 5 import telemetry.core.platform.power_monitor as power_monitor |
6 | 6 |
7 | 7 |
8 _TEMPERATURE_FILE = '/sys/class/thermal/thermal_zone0/temp' | 8 _TEMPERATURE_FILE = '/sys/class/thermal/thermal_zone0/temp' |
9 | 9 |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 for path_element in temperature_path[:-1]: | 51 for path_element in temperature_path[:-1]: |
52 if not path_element in temperature_insertion_point: | 52 if not path_element in temperature_insertion_point: |
53 temperature_insertion_point[path_element] = {} | 53 temperature_insertion_point[path_element] = {} |
54 temperature_insertion_point = temperature_insertion_point[path_element] | 54 temperature_insertion_point = temperature_insertion_point[path_element] |
55 assert temperature_path[-1] not in temperature_insertion_point | 55 assert temperature_path[-1] not in temperature_insertion_point |
56 temperature_insertion_point[temperature_path[-1]] = average_temperature | 56 temperature_insertion_point[temperature_path[-1]] = average_temperature |
57 | 57 |
58 return power_data | 58 return power_data |
59 | 59 |
60 def _GetBoardTemperatureCelsius(self): | 60 def _GetBoardTemperatureCelsius(self): |
61 contents = self._device.old_interface.GetFileContents(_TEMPERATURE_FILE) | 61 contents = self._device.ReadFile(_TEMPERATURE_FILE) |
62 if len(contents) > 0: | 62 if len(contents) > 0: |
63 return float(contents[0]) | 63 return float(contents[0]) |
64 return None | 64 return None |
65 | 65 |
OLD | NEW |