mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-10-23 22:32:40 +00:00
Use lastSeen from zigbee-herdsman.
This commit is contained in:
1 parent
798a4ee565
commit
9c5b3bf4d1
12 files changed
+46
-79
No files matched your search
+9
-2
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user