Calling hass.entity methods, or hass.call prior to the application initializing will result in an error log onReady, alerting to the incorrect code pattern
function ExampleService({ hass, lifecycle }:TServiceParams) {
const list = hass.entity.byLabel("my_label"); // ❌ ERROR LOG!
lifecycle.onReady(() => {
const list = hass.entity.byLabel("my_label"); // ✅
});
}
Checklist
[x] Read the contribution guide and accept the
code of conduct
Changes
Calling
hass.entity
methods, orhass.call
prior to the application initializing will result in an error logonReady
, alerting to the incorrect code patternChecklist