Skip to content

Latest commit

 

History

History
37 lines (27 loc) · 624 Bytes

File metadata and controls

37 lines (27 loc) · 624 Bytes
code type title description
false
page
Constructor
Decoder abstract class constructor

Decoder

Custom decoders must inherit the provided abstract Decoder class.

The super constructor must be called with the device model name.


Constructor

Decoder()

Example

import { Decoder } from 'kuzzle-plugin-device-manager';

class KarakoyDecoder extends Decoder {
  constructor () {
    super('Karakoy');
  }

  // This method must be implemented
  async decode (payload: JSONObject, request: KuzzleRequest): Promise<DeviceContent> {
    // ...custom device decoding function
  }
}