fineemb / lovelace-air-filter-card

用于Lovelace的小米空气净化器卡片
12 stars 9 forks source link

Default sample breaks lovelace rendering #8

Open srobroek opened 4 years ago

srobroek commented 4 years ago

When installing this card in a clean lovelace UI using the sample provided, the entire lovelace dashboard stops rendering.

image

config used for the card

`type: 'custom:air-filter' modes:

`title: Home views:

dseifert commented 4 years ago

I have the same issue. Developer console says:

Uncaught TypeError: mode.toLowerCase is not a function
    at HTMLElement.set hass [as hass] (air-filter-card.js:139)
    at HTMLElement.value (chunk.55cfcfe8bf5cea239c42.js:23033)
    at HTMLElement.value (chunk.55cfcfe8bf5cea239c42.js:23460)
    at HTMLElement.t.addEventListener.once (chunk.55cfcfe8bf5cea239c42.js:23033)
    at n (app.04756a98.js:1)
    at chunk.55cfcfe8bf5cea239c42.js:12717

and indeed the mode value of the Xiaomi Mi Air Purifier 3H is an integer, so can not be converted to lower case. The 3 and 3H models use a different protocol than older models (cmp. eg. https://github.com/rytilahti/python-miio/blob/master/miio/airpurifier.py#L20 and https://github.com/rytilahti/python-miio/blob/master/miio/airpurifier_miot.py#L54).