Emulation.setSensorOverrideEnabledOverrides a platform sensor of a given type. If |enabled| is true, calls to Sensor.start() will use a virtual sensor as backend rather than fetching data from a real hardware sensor. Otherwise, existing virtual sensor-backend Sensor objects will fire an error event and new calls to Sensor.start() will attempt to use a real sensor instead.
| Name | Type | Description |
|---|---|---|
enabled | boolean | |
type | SensorType | |
metadata (optional) | SensorMetadata |
{
"id": 1,
"method": "Emulation.setSensorOverrideEnabled",
"params": {
"enabled": true,
"type": "type-value"
}
}
{
"id": 1,
"result": {}
}
const result = await send('Emulation.setSensorOverrideEnabled', {"enabled": true, "type": "type-value"});
console.log(result);