MCPcopy
hub / github.com/Koenkk/zigbee2mqtt / loadSettingsWithDefaults

Function loadSettingsWithDefaults

lib/util/settings.ts:127–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

125let _settingsWithDefaults: Settings | undefined;
126
127function loadSettingsWithDefaults(): void {
128 if (!_settings) {
129 _settings = read();
130 }
131
132 _settingsWithDefaults = objectAssignDeep({}, defaults, getPersistedSettings()) as Settings;
133
134 if (!_settingsWithDefaults.devices) {
135 _settingsWithDefaults.devices = {};
136 }
137
138 if (!_settingsWithDefaults.groups) {
139 _settingsWithDefaults.groups = {};
140 }
141}
142
143function parseValueRef(text: string): {filename: string; key: string} | null {
144 const match = /!(.*) (.*)/g.exec(text);

Callers 3

writeMinimalDefaultsFunction · 0.85
writeFunction · 0.85
getFunction · 0.85

Calls 2

getPersistedSettingsFunction · 0.85
readFunction · 0.70

Tested by

no test coverage detected