---
title: estadodeldispositivo
slug: develop/es/estadodeldispositivo
docTags: 
createdAt: 2025-03-11T07:07:19.526Z
---

Este objeto proporciona información sobre el hardware, firmware y las funciones del dispositivo.

**IDL de devicestatus**

```text
interface devicestatus {
    Promise<BVNinformationList> getBVNPipelines();
    Promise<BVNinformationList> getBVNComponents();
    Promise<Powerinformation> getPowerStatus();
    Promise<ExtensionsinformationList> getExtensions();
    Promise<POEinformation> getPOEStatus();
};

interface Powerinformation {
    attribute String source;
    attribute String switch_mode;
    attribute String battery;
    attribute int soc_percent;
};

interface BVNinformation {
    attribute String name;
    attribute int index;
    attribute BVNRegisterList registers;
    attribute BVNPipelineList items;                //@Optional
};

interface BVNRegister {
    attribute String name;
    attribute int offset;
};

interface BVNPipeline {
    attribute String name;
};

interface Extensionsinformation {
    attribute String name;
    attribute int size;            //@Optional
    attribute String id;
    attribute String version       //SEMVER
};

interface POEpowerinformation {
    attribute float value;
    attribute String units;
};

interface POEinformation {
    attribute String status;
    attribute POEpowerinformation power;     //@Optional
};                                                                                                  
```

## Creación de objetos

Para crear un objeto *estadodeldispositivo* cargue el módulo *@brightsign/status* mediante el método  `require()` .

```javascript
var DeviceStatusClass = require("@brightsign/devicestatus");
var devicestatus = new DeviceStatusClass();
```

## devicestatus

### getPowerStatus()

```javascript
Promise<Powerinformation> getPowerStatus()
```

Devuelve el estado de la batería del dispositivo como "charging", "discharging", "complete", "absent" o "fault".

### getExtensions()

```javascript
Promise<ExtensionsinformationList> getExtensions()
```

Devuelve una promesa que produce un objeto que contiene una matriz `extensiones` con cada elemento que contiene al menos un campo `nombre` . También pueden estar presentes otros campos, pero no se debe depender de ellos.

### getPOEStatus()

```javascript
Promise<POEinformation> getPOEStatus()
```

Devuelve información sobre si la red PoE (Power over Ethernet) es compatible, está disponible y/o activa en un dispositivo.

## Powerinformation

- `fuente` <font color="#704ae0">string</font>:  Los valores posibles son "battery", "Ethernet" o "AC"
- `switch_mode` <font color="#704ae0">string</font>: Devuelve "soft" o "hard"
- `batería` <font color="#704ae0">string</font>: Los valores posibles son "charging", "discharging", "complete", "absent" o "fault"
- `soc_percent` <font color="#704ae0">int</font>: El estado de carga de la batería en porcentaje desde 0 (vacía) hasta 100 (llena)

## Extensionsinformation

- `nombre` <font color="#704ae0">string</font>: El nombre de la extensión
- `tamaño` <font color="#704ae0">int</font>: Algunas extensiones devuelven un tamaño y otras no. Los reproductores que tienen instaladas licencias AC3 o E-AC3 las reportarán como extensiones, pero no se incluirá ningún tamaño.
- `id` <font color="#704ae0">string</font>: El id de la extensión
- `versión` <font color="#704ae0">string</font>: La versión de la extensión

## POEpowerinformation

- `valor` <font color="#704ae0">float</font>: Devuelve el "Power value"
- `unidades` <font color="#704ae0">string</font>: devuelve las unidades del "Power value" ("W")

## POEinformation

- `estado` <font color="#704ae0">string</font>: La cadena de estado puede ser "active", "standby" o "inactive"
- `poder` <font color="#704ae0">POEpowerinformation</font>: Consulte `POEpowerinformation` arriba para obtener más detalles.

## Ejemplo

Para obtener el estado de alimentación de un dispositivo:

```javascript
var DeviceStatusClass = require("@brightsign/devicestatus");
var devicestatus = new DeviceStatusClass();

devicestatus.getPowerStatus().then(
        function(data){
                console.log(JSON.stringify(data));
        })
    .catch(
        function(data){
                console.log("Error: " + data);
        })
```

