Skip to content

Commit

Permalink
Handle non-numeric room id marked as number
Browse files Browse the repository at this point in the history
  • Loading branch information
PiotrMachowski authored Nov 7, 2023
1 parent 77681d3 commit 2b13470
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/xiaomi-vacuum-map-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,8 @@ export class XiaomiVacuumMapCard extends LitElement {

private static adjustRoomId(roomId: string | number, config: MapMode): string | number {
if (config.idType === "number") {
return +roomId;
const roomIdAsNumber = +roomId;
return isNaN(roomIdAsNumber) ? roomId : roomIdAsNumber;
}
return roomId;
}
Expand Down

0 comments on commit 2b13470

Please sign in to comment.