Lines Matching refs:thermal

1 # @ohos.thermal (Thermal Management)
3 The **thermal** module provides thermal level-related callback and query APIs to obtain the informa…
12 import {thermal} from '@kit.BasicServicesKit';
15 ## thermal.registerThermalLevelCallback<sup>9+</sup>
19 Subscribes to thermal level changes.
27 | callback | Callback&lt;ThermalLevel&gt; | Yes | Callback used to return thermal level. This para…
31 For details about the error codes, see [Thermal Manager Error Codes](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>
55 Unsubscribes from thermal level changes.
67 For details about the error codes, see [Thermal Manager Error Codes](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>
91 Obtains the current thermal level.
103 For details about the error codes, see [Thermal Manager Error Codes](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 > **NOTE**<br>This API is deprecated since API version 9. You are advised to use [thermal.registerT…
126 Subscribes to thermal level changes.
134 …k used to return the result. The return value contains only one parameter, that is, thermal level.|
139 thermal.subscribeThermalLevel((err: Error, level: thermal.ThermalLevel) => {
140 console.info('thermal level is: ' + level);
144 ## thermal.unsubscribeThermalLevel<sup>(deprecated)</sup>
148 > **NOTE**<br>This API is deprecated since API version 9. You are advised to use [thermal.unregiste…
150 Unsubscribes from thermal level changes.
163 thermal.unsubscribeThermalLevel(() => {
164 console.info('unsubscribe thermal level success.');
168 ## thermal.getThermalLevel<sup>(deprecated)</sup>
172 > **NOTE**<br>This API is deprecated since API version 9. You are advised to use [thermal.getLevel]…
174 Obtains the current thermal level.
187 let level = thermal.getThermalLevel();
188 console.info('thermal level is: ' + level);
193 Enumerates thermal levels.