Skip to content

Commit e6b05ff

Browse files
committed
option to clear cached data
1 parent d515267 commit e6b05ff

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

main.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ app.on('activate', () => {
212212

213213
app.on('quit', stop);
214214

215+
216+
215217
const localNames = pjson.load('names_' + config.ccuAddress) || {};
216218
const localRegaId = {};
217219
// Const localNamesIds = {};
@@ -513,6 +515,13 @@ function initIpc() {
513515
ipcRpc.on('config', params => {
514516
config = params[0];
515517
// Console.log(config);
518+
if (config.clearCache) {
519+
log.info('clear cache');
520+
delete config.clearCache;
521+
pjson.save('names_' + config.ccuAddress, {});
522+
pjson.save('devices_' + config.ccuAddress, {});
523+
pjson.save('paramset-descriptions-v2_' + config.ccuAddress, {});
524+
}
516525
pjson.save('config', config);
517526
app.relaunch();
518527
mainWindow.destroy();

www/css/homematic-manager.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,4 +310,9 @@ textarea {
310310
#qr {
311311
width: 280px;
312312
height: 210px;
313+
}
314+
315+
#dialog-config label {
316+
width: 210px;
317+
display: inline-block;
313318
}

www/index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,11 @@ <h4 class="externalLink" id="linkLicense" data-href="https://www.gnu.org/license
305305

306306
<p>
307307
<label for="rpc-log-folder" class="translate">RPC Log Folder</label>
308-
<input id="rpc-log-folder" type="text">
308+
<input id="rpc-log-folder" size="50">
309+
</p>
310+
<p>
311+
<label for="clear-cache" class="translate">Clear Cache</label>
312+
<input id="clear-cache" type="checkbox">
309313
</p>
310314

311315
</div>

www/js/homematic-manager.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,7 @@ function initDialogsMisc() {
553553
config.rpcInitIp = $.trim($('#init-ip-select').val());
554554
config.ccuAddress = $.trim($('#ccu-address').val());
555555
config.rpcLogFolder = $.trim($('#rpc-log-folder').val());
556+
config.clearCache = $.trim($('#clear-cache').is(':checked'));
556557
ipcRpc.send('config', [config]);
557558
}
558559
},

0 commit comments

Comments
 (0)