Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

Commit

Permalink
Add 7d incidence to attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
foosel committed Nov 1, 2020
1 parent cd5584e commit 61944f5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion custom_components/coronavirus_hessen/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

_LOGGER = logging.getLogger(__name__)

ATTR_CASES = "cases"
ATTR_DEATHS = "deaths"
ATTR_INCIDENCE = "incidence"

async def async_setup_entry(hass, config_entry, async_add_entities):
"""Defer sensor setup to the shared sensor module."""
Expand Down Expand Up @@ -59,7 +61,9 @@ def state(self):
@property
def device_state_attributes(self):
return {ATTR_ATTRIBUTION: ATTRIBUTION,
ATTR_DEATHS: self.coordinator.data[self.county]["deaths"]}
ATTR_CASES: self.coordinator.data[self.county]["cases"],
ATTR_DEATHS: self.coordinator.data[self.county]["deaths"],
ATTR_INCIDENCE: self.coordinator.data[self.county]["incidence"]}

async def async_added_to_hass(self):
"""When entity is added to hass."""
Expand Down

0 comments on commit 61944f5

Please sign in to comment.