Add config entry for Flu Near You (#32858)

* Add config flow for Flu Near You

* Cleanup

* Cleanup

* Add tests

* Add test requirements

* Code review

* Reduce unnecessary async-ness

* Handle API registration

* Cleanup

* Update homeassistant/components/flunearyou/.translations/en.json

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Code review

* Ensure config schema allows additional keys

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
Aaron Bach 2020-04-02 17:54:11 -06:00 committed by GitHub
parent 55870aec31
commit cb058ff6c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 521 additions and 125 deletions

View file

@ -0,0 +1,38 @@
"""Define flunearyou constants."""
import logging
DOMAIN = "flunearyou"
LOGGER = logging.getLogger("homeassistant.components.flunearyou")
DATA_CLIENT = "client"
CATEGORY_CDC_REPORT = "cdc_report"
CATEGORY_USER_REPORT = "user_report"
TOPIC_UPDATE = "flunearyou_update"
TYPE_CDC_LEVEL = "level"
TYPE_CDC_LEVEL2 = "level2"
TYPE_USER_CHICK = "chick"
TYPE_USER_DENGUE = "dengue"
TYPE_USER_FLU = "flu"
TYPE_USER_LEPTO = "lepto"
TYPE_USER_NO_SYMPTOMS = "none"
TYPE_USER_SYMPTOMS = "symptoms"
TYPE_USER_TOTAL = "total"
SENSORS = {
CATEGORY_CDC_REPORT: [
(TYPE_CDC_LEVEL, "CDC Level", "mdi:biohazard", None),
(TYPE_CDC_LEVEL2, "CDC Level 2", "mdi:biohazard", None),
],
CATEGORY_USER_REPORT: [
(TYPE_USER_CHICK, "Avian Flu Symptoms", "mdi:alert", "reports"),
(TYPE_USER_DENGUE, "Dengue Fever Symptoms", "mdi:alert", "reports"),
(TYPE_USER_FLU, "Flu Symptoms", "mdi:alert", "reports"),
(TYPE_USER_LEPTO, "Leptospirosis Symptoms", "mdi:alert", "reports"),
(TYPE_USER_NO_SYMPTOMS, "No Symptoms", "mdi:alert", "reports"),
(TYPE_USER_SYMPTOMS, "Flu-like Symptoms", "mdi:alert", "reports"),
(TYPE_USER_TOTAL, "Total Symptoms", "mdi:alert", "reports"),
],
}