UNPKG

homebridge-flume

Version:

Homebridge plugin to integrate Flume devices into HomeKit.

25 lines 638 B
import storage from 'node-persist'; import { PLUGIN_NAME } from '../homebridge/settings.js'; export const STORAGE_KEY_AUTH = 'auth'; async function init(dir) { await storage.init({ dir: dir, forgiveParseErrors: true }); } export async function storageGet(dir, key) { try { await init(dir); return await storage.get(`${PLUGIN_NAME}:${key}`); } catch (err) { return null; } } export async function storageSet(dir, key, value) { try { await init(dir); storage.set(`${PLUGIN_NAME}:${key}`, value); } catch { // Nothing } } //# sourceMappingURL=storage.js.map