homebridge-bthome
Advanced tools
Comparing version 1.2.0-beta.0 to 1.2.0
@@ -54,6 +54,6 @@ import { EventEmitter } from 'events'; | ||
} | ||
const mac = peripheral.address.toLowerCase(); | ||
const name = advertisementData.localName || this.generateDeviceName(mac); | ||
const serviceData = service.data; | ||
const manufacturerData = this.decodeManufacturerData(advertisementData.manufacturerData); | ||
const mac = peripheral.address.toLowerCase() || manufacturerData?.mac?.toLowerCase() || 'unknown'; | ||
const name = advertisementData.localName || this.generateDeviceName(mac); | ||
if (!manufacturerData.serialNumber) { | ||
@@ -60,0 +60,0 @@ manufacturerData.serialNumber = mac; |
function decodeModelName(identifier) { | ||
switch (identifier) { | ||
case 0x0001: | ||
return 'Shelly BLU Button1'; | ||
return 'SBBT-002C'; | ||
case 0x0002: | ||
return 'Shelly BLU DoorWindow'; | ||
return 'SBDW-002C'; | ||
case 0x0003: | ||
return 'Shelly BLU HT'; | ||
return 'SBHT-003C'; | ||
case 0x0005: | ||
return 'Shelly BLU Motion'; | ||
return 'SBMO-003Z'; | ||
case 0x0006: | ||
return 'Shelly BLU Wall Switch 4'; | ||
return 'SBBT-004CEU'; | ||
case 0x0007: | ||
return 'Shelly BLU RC Button 4'; | ||
return 'SBBT-004CUS'; | ||
case 0x0008: | ||
return 'Shelly BLU TRV'; | ||
return 'SBTR-001AEU'; | ||
} | ||
@@ -29,2 +29,3 @@ } | ||
case 0x0A: | ||
result.mac = data.subarray(offset + 1, offset + 7).reverse().toString('hex').match(/.{1,2}/g)?.join(':'); | ||
offset += 7; | ||
@@ -31,0 +32,0 @@ break; |
@@ -11,4 +11,5 @@ export type BluetoothDevice = { | ||
serialNumber?: string; | ||
mac?: string; | ||
}; | ||
export declare class BluetoothError extends Error { | ||
} |
@@ -50,3 +50,3 @@ import { BTHomeAccessory } from './platformAccessory.js'; | ||
if (!config) { | ||
this.log.debug('Skipping not configured device: ', mac); | ||
this.log.debug('Skipping not configured device:', mac); | ||
return; | ||
@@ -53,0 +53,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"type": "module", | ||
"version": "1.2.0-beta.0", | ||
"version": "1.2.0", | ||
"description": "A homebridge plugin that adds support for bluetooth devices that use BTHome protocol.", | ||
@@ -8,0 +8,0 @@ "author": "Boris Yonchev", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
72098
901
0