You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
625 B
JavaScript

const MessageManager = require("../MessageManager")
4 years ago
const PagerDevice = require("./Device")
const Str = require('@supercharge/strings')
4 years ago
// Birdy Slim (IoT) Device
class BirdySlim extends PagerDevice {
constructor () {
super()
this.duplex = true
4 years ago
this.name = "birdyslim"
}
RandID() {
return `B${ Str.random(4) }`
}
async formatTX(msg) {
msg.id = this.RandID()
await MessageManager.BindMsg(msg)
msg.payload = msg.type === 'duplex' ? `${ msg.id }${ msg.payload }` : msg.payload // only if duplex wanted we add the id
4 years ago
}
}
module.exports = BirdySlim