diff --git a/custom_components/coronavirus_hessen/__init__.py b/custom_components/coronavirus_hessen/__init__.py index f90be60..f46b69f 100644 --- a/custom_components/coronavirus_hessen/__init__.py +++ b/custom_components/coronavirus_hessen/__init__.py @@ -78,14 +78,13 @@ async def async_get_data(): for row in rows[2:]: line = row.select("td") - if len(line) != 7: + if len(line) != 6: continue try: county = line[0].get_text(" ", strip=True) cases = parse_num(line[1].get_text(" ", strip=True)) - hospitalized = parse_num(line[2].get_text(" ", strip=True)) - deaths = parse_num(line[3].get_text(" ", strip=True)) + deaths = parse_num(line[2].get_text(" ", strip=True)) except: _LOGGER.exception("Error processing line {}, skipping".format(line)) continue @@ -94,7 +93,7 @@ async def async_get_data(): if county == "Gesamtergebnis": county = OPTION_TOTAL - result[county] = dict(cases=cases, hospitalized=hospitalized, deaths=deaths) + result[county] = dict(cases=cases, deaths=deaths) _LOGGER.debug("Corona Hessen: {!r}".format(result)) return result diff --git a/custom_components/coronavirus_hessen/sensor.py b/custom_components/coronavirus_hessen/sensor.py index 3d999dd..8ab26a8 100644 --- a/custom_components/coronavirus_hessen/sensor.py +++ b/custom_components/coronavirus_hessen/sensor.py @@ -12,7 +12,6 @@ _LOGGER = logging.getLogger(__name__) ATTR_DEATHS = "deaths" -ATTR_HOSPITALIZED = "hospitalized" async def async_setup_entry(hass, config_entry, async_add_entities): """Defer sensor setup to the shared sensor module.""" @@ -60,7 +59,6 @@ def state(self): @property def device_state_attributes(self): return {ATTR_ATTRIBUTION: ATTRIBUTION, - ATTR_HOSPITALIZED: self.coordinator.data[self.county]["hospitalized"], ATTR_DEATHS: self.coordinator.data[self.county]["deaths"]} async def async_added_to_hass(self):