This repository was archived by the owner on Nov 19, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed
custom_components/coronavirus_hessen Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -78,14 +78,13 @@ async def async_get_data():
7878
7979 for row in rows [2 :]:
8080 line = row .select ("td" )
81- if len (line ) != 7 :
81+ if len (line ) != 6 :
8282 continue
8383
8484 try :
8585 county = line [0 ].get_text (" " , strip = True )
8686 cases = parse_num (line [1 ].get_text (" " , strip = True ))
87- hospitalized = parse_num (line [2 ].get_text (" " , strip = True ))
88- deaths = parse_num (line [3 ].get_text (" " , strip = True ))
87+ deaths = parse_num (line [2 ].get_text (" " , strip = True ))
8988 except :
9089 _LOGGER .exception ("Error processing line {}, skipping" .format (line ))
9190 continue
@@ -94,7 +93,7 @@ async def async_get_data():
9493 if county == "Gesamtergebnis" :
9594 county = OPTION_TOTAL
9695
97- result [county ] = dict (cases = cases , hospitalized = hospitalized , deaths = deaths )
96+ result [county ] = dict (cases = cases , deaths = deaths )
9897
9998 _LOGGER .debug ("Corona Hessen: {!r}" .format (result ))
10099 return result
Original file line number Diff line number Diff line change 1212_LOGGER = logging .getLogger (__name__ )
1313
1414ATTR_DEATHS = "deaths"
15- ATTR_HOSPITALIZED = "hospitalized"
1615
1716async def async_setup_entry (hass , config_entry , async_add_entities ):
1817 """Defer sensor setup to the shared sensor module."""
@@ -60,7 +59,6 @@ def state(self):
6059 @property
6160 def device_state_attributes (self ):
6261 return {ATTR_ATTRIBUTION : ATTRIBUTION ,
63- ATTR_HOSPITALIZED : self .coordinator .data [self .county ]["hospitalized" ],
6462 ATTR_DEATHS : self .coordinator .data [self .county ]["deaths" ]}
6563
6664 async def async_added_to_hass (self ):
You can’t perform that action at this time.
0 commit comments