MM module for current COVID-19 virus status.
This data is derived from Johns Hopkins University Center for Systems Science and Engineering (JHU CCSE) via API by Laeyoung / COVID-19-API
Original data is located here
cd ~/MagicMirror/modules
git clone https://github.com/eouia/MMM-COVID-19
{
module: "MMM-COVID-19",
header: "COVID-19",
position: "top_left",
config:{}
}
These values are set as default, you don't need to copy all of these. Just pick what you need only and add it into your
config:{}
config: {
scanInterval: 1000 * 60 * 60 * 12,
rotateInterval: 1000 * 5,
detailProvince: false,
pinned: ["Others", "Diamond Princess cruise ship"],
logProvinceCountry: false,
logOnce: true,
sortOrder: null,
}
scanInterval
: ms. Original data is updated once per day. So too frequent scanning is not needed.rotateInterval
: ms. Interval for rotating region infected.detailProvice
: Iftrue
, the data from provinces of country (US, China, Canada) will be shown. Iffalse
, sum of country will be shown.pinned
: If notnull
, your second slot will showpinned region
. The structure is[COUNTRY_NAME, PROVINCE_NAME]
. WhenPROVINCE_NAME
is omitted or invalid, data(if exists, sum of provinces) ofCOUNTRY_NAME
will be shown. (e.g:null
,["US"]
,["US", "Seattle, WA"]
)
To get
COUNTRY_NAME
andPROVINCE_NAME
, setlogProvinceCountry:true
then find it from your backend log, or find it directly from https://github.com/CSSEGISandData/COVID-19/tree/master/csse_covid_19_data/csse_covid_19_daily_reports
logProvinceCountry
: Iftrue
,COUNTRY_NAME
andPROVINCE_NAME
will be listed in your backend log.logOnce
: Iftrue
, Just log once on start.sortOrder
: Don't mind. but if you want to change the order, assign callback function for sort. Default is ;
(a, b)=> {
if (b.countryregion !== a.countryregion) return (a.countryregion < b.countryregion) ? -1 : 1
if (b.provincestate !== a.provincestate) return (a.provincestate < b.provincestate) ? -1 : 1
if (b.confirmed !== a.confirmed) return b.confirmed - a.confirmed
if (b.deaths !== a.deaths) return b.deaths - a.deaths
return b.recover - a.recover
}