Temperature and Humidity

Last Updated on : 2021-08-27 11:07:18download

TYIpcTempHumi is used to display the temperature and humidity values. By default, the component uses standard data points (DPs). You can set the temperature and humidity standard DPs. You can also customize the DP values.

IP cameras (IPCs) support the following temperature and humidity standard DPs. For more information about the detailed parameters of the DPs, see the configurations of each IPC.

  • sensor_temperature (report temperature in °C)
  • temp_report_f (report temperature in °F)
  • temp_unit_select (display the temperature unit)
  • sensor_humidity (report humidity)

Preview

Temperature and Humidity

Properties

Field name Data type Description Default value
standardDpMode boolean Indicates whether standard DPs are used. true
sensor_temperature number The temperature in °C. undefined
temp_report_f ViewStyle The temperature in °F. undefined
temp_unit_select string The temperature unit. ‘0’
sensor_humidity number The humidity. undefined
containerStyle ViewStyle The style of the container. {}
iconBoxStyle ViewStyle The style of the icon container. {}
tempIcon number The temperature icon. undefined
tempIconImgStyle ImageStyle The style of the temperature icon. {}
tempIconTextStyle TextStyle The style of the temperature text. {}
humiIcon number The humidity icon. undefined
humiIconImgStyle ImageStyle The style of the humidity icon. {}
humiIconTextStyle TextStyle The style of the humidity text. {}

Example

import { TYIpcTempHumi } from '@tuya/tuya-panel-ipc-sdk';
...
  // Standard DPs.
   <TYIpcTempHumi
     sensor_temperature={20}
     temp_report_f={100}
     sensor_humidity={10}
     // The temperature unit. Valid values: `0` means °C and `1` means °F. Default value: `0`.
     temp_unit_select={'0'}
   />
   // Custom DPs.
   <TYIpcTempHumi
     standardDpMode={false}
     sensor_temperature={20}
     temp_report_f={100}
     sensor_humidity={10}
     temp_unit_select={'1'}
   />