File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -415,6 +415,9 @@ export class Chart extends LitElement {
415415 }
416416
417417 let entity = this . states [ getEntityId ( entityConf ) ] ;
418+ if ( ! entity ) {
419+ throw new Error ( 'Entity not found ' + getEntityId ( entityConf ) ) ;
420+ }
418421
419422 if ( entityConf . type === 'passthrough' ) {
420423 const connections = this . connectionsByChild . get ( entityConf ) ;
Original file line number Diff line number Diff line change @@ -73,7 +73,9 @@ export class SankeyChart extends SubscribeMixin(LitElement) {
7373 const stats = await getStatistics ( this . hass , data , this . entityIds ) ;
7474 const states : HassEntities = { } ;
7575 Object . keys ( stats ) . forEach ( id => {
76- states [ id ] = { ...this . hass . states [ id ] , state : String ( stats [ id ] ) } ;
76+ if ( this . hass . states [ id ] ) {
77+ states [ id ] = { ...this . hass . states [ id ] , state : String ( stats [ id ] ) } ;
78+ }
7779 } ) ;
7880 this . states = states ;
7981 // this.requestUpdate();
You can’t perform that action at this time.
0 commit comments