diff --git a/README.md b/README.md index 1284ede..612d22a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # streamdeck-homeassistant -The aim of this project is to allow owners of an eglato StreamDeck to control their entities or display sensor data via +The aim of this project is to allow owners of an elgato StreamDeck to control their entities or display sensor data via their StreamDeck. As the code is kept very generic, nearly every sensor should work out of the box as well as every service that does not need any more information but the entity id. diff --git a/src/modules/plugin/imageUtils.js b/src/modules/plugin/imageUtils.js index 39b6809..09ca9d1 100644 --- a/src/modules/plugin/imageUtils.js +++ b/src/modules/plugin/imageUtils.js @@ -99,7 +99,7 @@ export const IconFactory = { }, default: (state, attributes, labelTemplate) => { - return Icon.labelledIcon(state, attributes, labelTemplate) + return Icon.labelledIcon(state, attributes, labelTemplate || IconFactory.sensor._defaultLabelTemplate) } } @@ -217,8 +217,8 @@ const Icon = { return `${weatherIcon}` }, - labelledIcon: (state, attributes, templates, image = "", labelTopOffset = 30) => { - const line1 = new Handlebars.compile(templates.line1)({...{state}, ...attributes, ...{colors}}) + labelledIcon: (state, attributes, templates = {}, image = "", labelTopOffset = 30) => { + const line1 = new Handlebars.compile(templates.line1 || "{{state}}")({...{state}, ...attributes, ...{colors}}) const line2 = new Handlebars.compile(templates.line2 || "")({...{state}, ...attributes, ...{colors}}) const line3 = new Handlebars.compile(templates.line3 || "")({...{state}, ...attributes, ...{colors}})