Lines Matching refs:thermal
1 # @ohos.thermal (热管理)
12 import {thermal} from '@kit.BasicServicesKit';
15 ## thermal.registerThermalLevelCallback<sup>9+</sup>
31 以下错误码的详细介绍请参见[热管理错误码](errorcode-thermal.md)。
42 thermal.registerThermalLevelCallback((level: thermal.ThermalLevel) => {
43 console.info('thermal level is: ' + level);
45 console.info('register thermal level callback success.');
47 console.error('register thermal level callback failed, err: ' + err);
51 ## thermal.unregisterThermalLevelCallback<sup>9+</sup>
67 以下错误码的详细介绍请参见[热管理错误码](errorcode-thermal.md)。
78 thermal.unregisterThermalLevelCallback(() => {
79 console.info('unsubscribe thermal level success.');
81 console.info('unregister thermal level callback success.');
83 console.error('unregister thermal level callback failed, err: ' + err);
87 ## thermal.getLevel<sup>9+</sup>
103 以下错误码的详细介绍请参见[热管理错误码](errorcode-thermal.md)。
113 let level = thermal.getLevel();
114 console.info('thermal level is: ' + level);
116 console.error('get thermal level failed, err: ' + err);
120 ## thermal.subscribeThermalLevel<sup>(deprecated)</sup>
124 > **说明:**<br>从API version 9开始不再维护,建议使用[thermal.registerThermalLevelCallback](#thermalregistertherma…
139 thermal.subscribeThermalLevel((err: Error, level: thermal.ThermalLevel) => {
140 console.info('thermal level is: ' + level);
144 ## thermal.unsubscribeThermalLevel<sup>(deprecated)</sup>
148 > **说明:**<br>从API version 9开始不再维护,建议使用[thermal.unregisterThermalLevelCallback](#thermalunregisterth…
163 thermal.unsubscribeThermalLevel(() => {
164 console.info('unsubscribe thermal level success.');
168 ## thermal.getThermalLevel<sup>(deprecated)</sup>
172 > **说明:**<br>从API version 9开始不再维护,建议使用[thermal.getLevel](#thermalgetlevel9)替代。
187 let level = thermal.getThermalLevel();
188 console.info('thermal level is: ' + level);