Tom-Hirschberger/MMM-ValuesByNotification

Errors in console

Closed this issue · 2 comments

Keep getting this error in console for the module, FYI. I'm not using any replace functions (yet).

MMM-ValuesByNotification.js:304 TypeError: value.replace is not a function
at Class.getValueDomElement (MMM-ValuesByNotification.js:299:21)
at Class.getItemDomElement (MMM-ValuesByNotification.js:611:29)
at Class.getGroupDomElement (MMM-ValuesByNotification.js:838:27)
at Class.getGroupsDomElement (MMM-ValuesByNotification.js:1118:28)
at Class.getDom (MMM-ValuesByNotification.js:1182:28)
at main.js:113:35
at new Promise ()
at updateDom (main.js:111:10)
at Object.updateDom (main.js:552:4)
at Class.updateDom (module.js:358:6)

Hi,

found the problem but need a moment to fix it.
I need to replace newlines before the valueFormat is processed but the replacement is called even if there is no valueFormat configured at the moment.
As a second problem i did not care about types and call the replacement if a number is selected of a json object. But numbers do not have a replace function.

As the replacement fails the valueFormat is not processed.

I will provide a fix for both problems in the next days.

Fixed with version 0.0.8