ha: merge read & parse logic

pull/3375/head
Rob Pilling 2024-04-21 19:29:44 +01:00
parent e2a62eabca
commit 60c6f35151
1 changed files with 1 additions and 2 deletions

View File

@ -36,8 +36,7 @@ exports.getTriggers = function(){
var triggers;
try{
triggers = require("Storage").read("ha.trigger.json");
triggers = JSON.parse(triggers);
triggers = JSON.parse(require("Storage").read("ha.trigger.json"));
} catch(e) {
// In case there are no user triggers yet, we show the default...
console.log("ha: error loading triggers:", e);