You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create a new widget. Following the latest documentation (generated March 2023 apparently), I can't get the widget to work as the browser javascript console always complains with "can't convert undefined to object". This also happens when I copy paste the example basewidget from the documentation (baselight).
The error appears to come from the code behind WidgetBase.call(self, widget_id, url, skin, parameters, monitored_entities, callbacks). In my simple widget, both monitored_entities and callbacks are empty lists.
Version
4.4.2
Installation type
Home Assistant add-on
Relevant log output
Uncaught TypeError: can't convert undefined to object WidgetBase http://homeassistant.home:5050/javascript/dashboard.js:344 baseday_color http://homeassistant.home:5050/compiled_javascript/application.js:3127 <anonymous> http://homeassistant.home:5050/compiled_javascript/default/livingroom_init.js:84 jQuery 13 j k setTimeout handler*Deferred/then/g/< i fireWith fire i fireWith ready R EventListener.handleEvent* <anonymous> <anonymous>dashboard.js:344:12 WidgetBase http://homeassistant.home:5050/javascript/dashboard.js:344 baseday_color http://homeassistant.home:5050/compiled_javascript/application.js:3127 <anonymous> http://homeassistant.home:5050/compiled_javascript/default/livingroom_init.js:84 jQuery 13 j k (Async: setTimeout handler) g i fireWith fire i fireWith ready R (Async: EventListener.handleEvent) <anonymous> <anonymous> <anonymous>
Relevant code in the app or config file that caused the issue
functionbaseday_color(widget_id, url, skin, parameters) {
self = this
self.widget_id = widget_id
self.parameters = parameters
var monitored_entities = []
var callbacks = []
WidgetBase.call(self, widget_id, url, skin, parameters, monitored_entities, callbacks)
functionupdateColor() {
var days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
var colors = ["violet", "red", "orange", "yellow", "green", "blue", "indigo"];
var date = new Date();
var dayName = days[date.getDay()];
var color = colors[date.getDay()];
$("#day_color_content").html(dayName);$("#day_color_content").css("background-color", color);
}
updateColor();
setInterval(updateColor, 1000 * 60 * 60); // Update every hour
}
Anything else?
No response
The text was updated successfully, but these errors were encountered:
What happened?
I'm trying to create a new widget. Following the latest documentation (generated March 2023 apparently), I can't get the widget to work as the browser javascript console always complains with "
can't convert undefined to object
". This also happens when I copy paste the example basewidget from the documentation (baselight
).The error appears to come from the code behind
WidgetBase.call(self, widget_id, url, skin, parameters, monitored_entities, callbacks)
. In my simple widget, bothmonitored_entities
andcallbacks
are empty lists.Version
4.4.2
Installation type
Home Assistant add-on
Relevant log output
Relevant code in the app or config file that caused the issue
Anything else?
No response
The text was updated successfully, but these errors were encountered: