MCPcopy
hub / github.com/aholstenson/miio / get

Method get

lib/tokens.js:26–35  ·  view source on GitHub ↗
(deviceId)

Source from the content-addressed store, hash-verified

24 }
25
26 get(deviceId) {
27 const now = Date.now();
28 const diff = now - this._lastSync;
29
30 if(diff > CHECK_TIME) {
31 return this._loadAndGet(deviceId);
32 }
33
34 return Promise.resolve(this._get(deviceId));
35 }
36
37 _get(deviceId) {
38 return this._data[deviceId];

Callers 4

findDeviceMethod · 0.80
findDeviceViaAddressMethod · 0.80
enrichMethod · 0.80
onMessageMethod · 0.80

Calls 2

_loadAndGetMethod · 0.95
_getMethod · 0.95

Tested by

no test coverage detected