Skip to main content

Introduction

This is useful when you need to recover a device from the list of devices. In this documentation all code was made for work as module so when you create machine = new Relay() or something like that, you can't use that variable outside the module.

But sometimes you need to recover the device from the list of devices, so you can use the Devices module.

Common Usage

import {Devices} from '@danidoble/webserial';

Devices.getJofemar(1); // the number is the device number (not adddress)

API

Devices.addCustom(type, device)
Devices.get(type, id)
Devices.getAll(type = null)
Devices.getJofemarByUuid(id)
Devices.getJofemar(device_number = 1)
Devices.getLockerByUuid(id)
Devices.getLocker(device_number = 1)
Devices.getRelayByUuid(id)
Devices.getRelay(device_number = 1)
Devices.getBoardroidByUuid(id)
Devices.getBoardroid(device_number = 1)
Devices.getArduinoByUuid(id)
Devices.getArduino(device_number = 1)
Devices.getCustom(type, device_number = 1)
Devices.getList()