SmartDeviceModel.getNetwork()

Requires:
@ray-js/panel-sdk≥1.0.0

Description

Get the network status of the smart device’s environment

Parameters

None

Return Value

Type: NetworkState
Network status object containing isConnected, networkType, signalStrength

Referenced Types

interfaceNetworkState
PropertyTypeDescription
isConnectedbooleanWhether connected
networkTypestringNetwork type: WIFI | 5G | 4G | 3G | 2G | GPRS | UNKNOWN | NONE
signalStrengthnumberSignal strength, unit: dBm

Examples

Example

const network = device.getNetwork();
console.log(network.isConnected);  // true
console.log(network.networkType);  // 'WIFI'