Use lastSeen from zigbee-herdsman.

This commit is contained in:
Koen Kanters committed 2019-09-12 22:48:23 +02:00
1 parent 798a4ee565
commit 9c5b3bf4d1
12 files changed
+46 -79

No files matched your search

+9 -2
View File
@@ -116,9 +116,16 @@ class Zigbee extends events.EventEmitter {
}
async resolveEntity(key) {
assert(typeof key === 'string' || key.constructor.name === 'Device', `Wrong type '${typeof key}'`);
assert(
typeof key === 'string' || typeof key === 'number' ||
key.constructor.name === 'Device', `Wrong type '${typeof key}'`
);
if (typeof key === 'string' || typeof key === 'number') {
if (typeof key === 'number') {
key = key.toString();
}
if (typeof key === 'string') {
if (key === 'coordinator') {
const coordinator = await this.getDevice({type: 'Coordinator'});
return {