Skip to content

Commit 460bcea

Browse files
Merge pull request #611 from PiotrMachowski/dev
v2.2.2
2 parents d610bf0 + 63f1b2f commit 460bcea

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "xiaomi-vacuum-map-card",
3-
"version": "v2.2.1",
3+
"version": "v2.2.2",
44
"description": "Xiaomi Vacuum Map Card",
55
"keywords": [
66
"home-assistant",

src/components/tile.ts

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export class Tile extends RootlessLitElement {
4444
}
4545
this.className = `tile-wrapper clickable ripple ${this.config.tile_id ? `tile-${this.config.tile_id}-wrapper` : ""}`;
4646
const stateObj = this.config.entity ? this.hass.states[this.config.entity] : undefined;
47+
if (!stateObj) return;
4748
const title = this.getTileLabel(stateObj);
4849
const value = this.getTileValue(stateObj);
4950
const icon = this.getIcon(stateObj);

src/localize/hass/compute_attribute_display.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export const computeAttributeValueDisplay = (
8787
const entityId = stateObj.entity_id;
8888
const domain = computeDomain(entityId);
8989
const deviceClass = stateObj.attributes.device_class;
90-
const registryEntry = entities[entityId] as
90+
const registryEntry = entities?.[entityId] as
9191
| EntityRegistryDisplayEntry
9292
| undefined;
9393
const translationKey = registryEntry?.translation_key;

src/localize/hass/compute_state_display.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const computeStateDisplay = (
4141
entities: HomeAssistantFixed["entities"],
4242
state?: string
4343
): string => {
44-
const entity = entities[stateObj.entity_id] as
44+
const entity = entities?.[stateObj.entity_id] as
4545
| EntityRegistryDisplayEntry
4646
| undefined;
4747

0 commit comments

Comments
 (0)