File tree 4 files changed +4
-3
lines changed
4 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " xiaomi-vacuum-map-card" ,
3
- "version" : " v2.2.1 " ,
3
+ "version" : " v2.2.2 " ,
4
4
"description" : " Xiaomi Vacuum Map Card" ,
5
5
"keywords" : [
6
6
" home-assistant" ,
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ export class Tile extends RootlessLitElement {
44
44
}
45
45
this . className = `tile-wrapper clickable ripple ${ this . config . tile_id ? `tile-${ this . config . tile_id } -wrapper` : "" } ` ;
46
46
const stateObj = this . config . entity ? this . hass . states [ this . config . entity ] : undefined ;
47
+ if ( ! stateObj ) return ;
47
48
const title = this . getTileLabel ( stateObj ) ;
48
49
const value = this . getTileValue ( stateObj ) ;
49
50
const icon = this . getIcon ( stateObj ) ;
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ export const computeAttributeValueDisplay = (
87
87
const entityId = stateObj . entity_id ;
88
88
const domain = computeDomain ( entityId ) ;
89
89
const deviceClass = stateObj . attributes . device_class ;
90
- const registryEntry = entities [ entityId ] as
90
+ const registryEntry = entities ?. [ entityId ] as
91
91
| EntityRegistryDisplayEntry
92
92
| undefined ;
93
93
const translationKey = registryEntry ?. translation_key ;
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ export const computeStateDisplay = (
41
41
entities : HomeAssistantFixed [ "entities" ] ,
42
42
state ?: string
43
43
) : string => {
44
- const entity = entities [ stateObj . entity_id ] as
44
+ const entity = entities ?. [ stateObj . entity_id ] as
45
45
| EntityRegistryDisplayEntry
46
46
| undefined ;
47
47
You can’t perform that action at this time.
0 commit comments