Compare commits
	
		
			6 Commits
		
	
	
		
			v1.0.3-rc1
			...
			v1.0.3-rc4
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | d2e8f77725 | ||
|  | 92e99e03ef | ||
|  | 903a512f99 | ||
|  | f385ee3a5a | ||
|  | 573f91e2f9 | ||
|  | 025a6475dd | 
							
								
								
									
										24
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								README.md
									
									
									
									
									
								
							| @@ -2,7 +2,8 @@ | |||||||
|  |  | ||||||
| ## Adding to your dashboard | ## Adding to your dashboard | ||||||
|  |  | ||||||
| You can add an overview of the current infection numbers to your dashboard using the [multiple-entity-row](https://github.com/benct/lovelace-multiple-entity-row) card: | You can add an overview of the current infection and vaccination numbers to your dashboard | ||||||
|  | using the [multiple-entity-row](https://github.com/benct/lovelace-multiple-entity-row) card: | ||||||
|  |  | ||||||
| ```yaml | ```yaml | ||||||
| type: entities | type: entities | ||||||
| @@ -24,4 +25,25 @@ entities: | |||||||
|     secondary_info: |     secondary_info: | ||||||
|       attribute: incidence |       attribute: incidence | ||||||
|       unit: cases/100k |       unit: cases/100k | ||||||
|  |   - type: custom:multiple-entity-row | ||||||
|  |     entity: sensor.covid_19_vaccinations_augsburg | ||||||
|  |     entities: | ||||||
|  |       - attribute: ratio_vaccinated_once | ||||||
|  |         name: Once | ||||||
|  |         format: precision1 | ||||||
|  |         unit: '%' | ||||||
|  |       - attribute: ratio_vaccinated_full | ||||||
|  |         name: Fully | ||||||
|  |         format: precision1 | ||||||
|  |         unit: '%' | ||||||
|  |       - attribute: ratio_vaccinated_total | ||||||
|  |         name: Total | ||||||
|  |         format: precision1 | ||||||
|  |         unit: '%' | ||||||
|  |     show_state: false | ||||||
|  |     icon: mdi:biohazard | ||||||
|  |     name: COVID-19 Vaccinations | ||||||
|  |     secondary_info: | ||||||
|  |       attribute: date | ||||||
|  |       format: date | ||||||
| ``` | ``` | ||||||
|   | |||||||
| @@ -12,7 +12,7 @@ if TYPE_CHECKING: | |||||||
|     from homeassistant.core import HomeAssistant |     from homeassistant.core import HomeAssistant | ||||||
|  |  | ||||||
| from .const import DOMAIN | from .const import DOMAIN | ||||||
| from .crawler import CovidCrawler, IncidenceData | from .crawler import CovidCrawler | ||||||
|  |  | ||||||
| _LOGGER = logging.getLogger(__name__) | _LOGGER = logging.getLogger(__name__) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -62,6 +62,7 @@ class VaccinationData: | |||||||
|  |  | ||||||
|     ratio_vaccinated_once: float = 0.0 |     ratio_vaccinated_once: float = 0.0 | ||||||
|     ratio_vaccinated_full: float = 0.0 |     ratio_vaccinated_full: float = 0.0 | ||||||
|  |     ratio_vaccinated_total: float = 0.0 | ||||||
|  |  | ||||||
|  |  | ||||||
| class CovidCrawlerBase(ABC): | class CovidCrawlerBase(ABC): | ||||||
| @@ -194,8 +195,11 @@ class CovidCrawler(CovidCrawlerBase): | |||||||
|         # https://www.augsburg.de/fileadmin/user_upload/buergerservice_rathaus/rathaus/statisiken_und_geodaten/statistiken/Monitoring/Demografiemonitoring_der_Stadt_Augsburg_2021.pdf |         # https://www.augsburg.de/fileadmin/user_upload/buergerservice_rathaus/rathaus/statisiken_und_geodaten/statistiken/Monitoring/Demografiemonitoring_der_Stadt_Augsburg_2021.pdf | ||||||
|         population = 299021 |         population = 299021 | ||||||
|  |  | ||||||
|         result.ratio_vaccinated_full = result.num_vaccinated_full / population |         result.ratio_vaccinated_full = result.num_vaccinated_full / population * 100 | ||||||
|         result.ratio_vaccinated_once = result.num_vaccinated_once / population |         result.ratio_vaccinated_once = result.num_vaccinated_once / population * 100 | ||||||
|  |         result.ratio_vaccinated_total = ( | ||||||
|  |             result.ratio_vaccinated_once + result.ratio_vaccinated_full | ||||||
|  |         ) | ||||||
|         _log.debug(f"Result data: {result}") |         _log.debug(f"Result data: {result}") | ||||||
|  |  | ||||||
|         return result |         return result | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| { | { | ||||||
|     "domain": "covid19_augsburg", |     "domain": "covid19_augsburg", | ||||||
|     "name": "COVID-19 Augsburg", |     "name": "COVID-19 Augsburg", | ||||||
|     "version": "0.1.0", |     "version": "1.1.0", | ||||||
|     "config_flow": true, |     "config_flow": true, | ||||||
|     "documentation": "https://github.com/AdrianoKF/home-assistant-covid19-augsburg", |     "documentation": "https://github.com/AdrianoKF/home-assistant-covid19-augsburg", | ||||||
|     "issue_tracker": "https://github.com/AdrianoKF/home-assistant-covid19-augsburg/issues", |     "issue_tracker": "https://github.com/AdrianoKF/home-assistant-covid19-augsburg/issues", | ||||||
|   | |||||||
| @@ -9,7 +9,12 @@ async def async_setup_entry(hass, _, async_add_entities): | |||||||
|     """Defer sensor setup to the shared sensor module.""" |     """Defer sensor setup to the shared sensor module.""" | ||||||
|     coordinator = await get_coordinator(hass) |     coordinator = await get_coordinator(hass) | ||||||
|  |  | ||||||
|     async_add_entities([CoronaAugsburgSensor(coordinator)]) |     async_add_entities( | ||||||
|  |         [ | ||||||
|  |             CoronaAugsburgSensor(coordinator), | ||||||
|  |             CoronaAugsburgVaccinationSensor(coordinator), | ||||||
|  |         ] | ||||||
|  |     ) | ||||||
|  |  | ||||||
|  |  | ||||||
| class CoronaAugsburgSensor(Entity): | class CoronaAugsburgSensor(Entity): | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user