dnguyen800 / air-visual-card

A Lovelace card showing air quality data from airvisual.com. Requires the AirVisual component.
MIT License
100 stars 35 forks source link

Sample configuration does not work #22

Closed BradleyFord closed 4 years ago

BradleyFord commented 4 years ago

I have installed via HACS, and tried to add the configuration to a card in a similar was to other custom cards but it is failing with a note about card type.

Is it possible to improve the sample and guide to be clearer?

Ndrinta commented 4 years ago

Can you post your code?

BradleyFord commented 4 years ago

Copying directly from the sample and then adjusting results in the following:

- air_pollution_level: sensor.u_s_air_pollution_level_2
  air_quality_index: sensor.u_s_air_quality_index_2
  city: Moscow
  main_pollutant: sensor.u_s_main_pollutant_2
  temp: weather.home
  type: 'custom:air-visual-card'

I have spent some more time on it just now, and it seems that adjusting the configuration in Lovelace to the following has worked.

type: 'custom:air-visual-card'
air_pollution_level: sensor.u_s_air_pollution_level_2
air_quality_index: sensor.u_s_air_quality_index_2
city: Moscow
main_pollutant: sensor.u_s_main_pollutant_2
temp: weather.home

I have submitted a change to your readme with the change; keeping your existing example and adding an example of the configuration via the UI