mirror of
https://github.com/sascha-hemi/hacs_waste_collection_schedule.git
synced 2026-03-21 05:06:33 +01:00
Added Gmina Miekinia Poland (#1984)
* Added source gmina_miekinia_pl * docs * table fix * refactor * refactor * reformatting + ./update_docu_links.py --------- Co-authored-by: 5ila5 <5ila5@users.noreply.github.com>
This commit is contained in:
@@ -1098,6 +1098,7 @@ Waste collection schedules in the following formats and countries are supported.
|
||||
<summary>Poland</summary>
|
||||
|
||||
- [Ecoharmonogram](/doc/source/ecoharmonogram_pl.md) / ecoharmonogram.pl
|
||||
- [Gmina Miękinia](/doc/source/gmina_miekinia_pl.md) / api.skycms.com.pl
|
||||
- [Poznań/Koziegłowy/Objezierze/Oborniki](/doc/source/sepan_remondis_pl.md) / sepan.remondis.pl
|
||||
- [Warsaw](/doc/source/warszawa19115_pl.md) / warszawa19115.pl
|
||||
- [Wrocław](/doc/source/ekosystem_wroc_pl.md) / ekosystem.wroc.pl
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
import datetime
|
||||
|
||||
import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "Gmina Miękinia"
|
||||
DESCRIPTION = "Source for Gmina Miękinia, Poland"
|
||||
URL = "https://api.skycms.com.pl"
|
||||
TEST_CASES = {
|
||||
"Brzezina": {"location_id": 8},
|
||||
}
|
||||
|
||||
ICON_MAP = {
|
||||
"Zmieszane": "mdi:trash-can", # Mixed
|
||||
"Tworzywa sztuczne": "mdi:recycle", # Plastic
|
||||
"Bioodpady": "mdi:leaf", # Organic
|
||||
"Papier": "mdi:file-outline", # Paper
|
||||
"Szkło": "mdi:glass-fragile", # Glass
|
||||
"Wielkogabaryty": "mdi:sofa-single",
|
||||
}
|
||||
|
||||
API_URL = "https://api.skycms.com.pl/api/v1/rest/garbage/disposals/"
|
||||
|
||||
|
||||
class Source:
|
||||
def __init__(self, location_id):
|
||||
self._location_id = location_id
|
||||
|
||||
def fetch(self):
|
||||
api_headers = {
|
||||
"x-skycms-key": "5d0123032115904c9d4ff70522405e60",
|
||||
"x-skycms-type": "iOS",
|
||||
"x-skycms-device": "04C977DF-F4BB-4541-AEF2-EB2F454CB4D2",
|
||||
}
|
||||
api_response = requests.get(
|
||||
API_URL + str(self._location_id), headers=api_headers
|
||||
)
|
||||
|
||||
entries = []
|
||||
|
||||
kinds = api_response.json()["data"]["garbage_kinds"]
|
||||
|
||||
for k in kinds:
|
||||
name = k["name"]
|
||||
for d in k["disposals"]:
|
||||
entries.append(
|
||||
Collection(
|
||||
date=datetime.datetime.strptime(d["id"], "%Y-%m-%d").date(),
|
||||
t=name.capitalize(),
|
||||
icon=ICON_MAP.get(name),
|
||||
)
|
||||
)
|
||||
|
||||
return entries
|
||||
44
doc/source/gmina_miekinia_pl.md
Normal file
44
doc/source/gmina_miekinia_pl.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# Gmina Miękinia
|
||||
|
||||
Support for schedules provided by [Gmina Miękinia](https://www.miekinia.pl/odpady/index.php?id=325) for Gmina Miękinia, Poland.
|
||||
|
||||
## Configuration via configuration.yaml
|
||||
|
||||
```yaml
|
||||
waste_collection_schedule:
|
||||
sources:
|
||||
- name: gmina_miekinia_pl
|
||||
args:
|
||||
location_id: LOCATION_ID
|
||||
```
|
||||
|
||||
### Configuration Variables
|
||||
|
||||
**location_id**
|
||||
*(string) (required)*
|
||||
|
||||
## Example
|
||||
|
||||
```yaml
|
||||
waste_collection_schedule:
|
||||
sources:
|
||||
- name: gmina_miekinia_pl
|
||||
args:
|
||||
location_id: 8
|
||||
```
|
||||
|
||||
## How to get the source arguments
|
||||
|
||||
Replace `LOCATION_ID` with following `id`:
|
||||
|
||||
| id | Location | Details |
|
||||
| --- | --- | --- |
|
||||
| 1 | Wróblowice, Gałów, Źródła, Lutynia - wielorodzinne | |
|
||||
| 2 | Miękinia, Mrozów, Wilkszyn - wielorodzinne | |
|
||||
| 3 | Kokorzyce, Żurawiniec, Krępice | |
|
||||
| 4 | Brzezinka Średzka, Pisarzowice, Miłoszyn, Gosławice, Prężyce | |
|
||||
| 5 | Lutynia | |
|
||||
| 6 | Zakrzyce, Gałów, Gałówek, Radakowice, Łowęcice | |
|
||||
| 7 | Wilkszyn I (wybrane ulice) | Wilkszyn 1 - poza ulicami: Grabowa,Wiśniowa, Wiśniowe Wzgórze, św. Jadwigi, św. Huberta, św. Mikołaja, św. Gerarda, św. Jacka, św. Krzysztofa, św. Piotra, Wiśniowogórska, św. Wacława, Lawendowa, Liliowa, Różana, Nasturcjowa, Jarzębinowa, Konwaliowa, Storczykowa, Parkowa, Sosnowa, Szafranowa, Topolowa, Chrobrego, Wrzosowa |
|
||||
| 8 | Brzezina, Wilkszyn II (wybrane ulice) | Wilkszyn tylko ulice: Grabowa,Wiśniowa, Wiśniowe Wzgórze, św. Jadwigi, św. Huberta, św. Mikołaja, św. Gerarda, św. Jacka, św. Krzysztofa, św. Piotra, Wiśniowogórska, św. Wacława, Lawendowa, Liliowa, Różana, Nasturcjowa, Jarzębinowa, Konwaliowa, Storczykowa, Parkowa, Sosnowa, Szafranowa, Topolowa, Chrobrego, Wrzosowa |
|
||||
| 9 | Miękinia | |
|
||||
2
info.md
2
info.md
@@ -31,7 +31,7 @@ Waste collection schedules from service provider web sites are updated daily, de
|
||||
| Netherlands | ACV Group, Alpen an den Rijn, Area Afval, Avalex, Avri, Bar Afvalbeheer, Circulus, Cyclus NV, Dar, Den Haag, GAD, Gemeente Almere, Gemeente Berkelland, Gemeente Cranendonck, Gemeente Hellendoorn, Gemeente Lingewaard, Gemeente Meppel, Gemeente Middelburg + Vlissingen, Gemeente Peel en Maas, Gemeente Schouwen-Duiveland, Gemeente Sudwest-Fryslan, Gemeente Venray, Gemeente Voorschoten, Gemeente Waalre, Gemeente Westland, HVC Groep, Meerlanden, Mijn Blink, PreZero, Purmerend, RAD BV, Reinis, Spaarnelanden, Twente Milieu, Waardlanden, Ximmio, ZRD |
|
||||
| New Zealand | Auckland Council, Christchurch City Council, Dunedin District Council, Gore, Invercargill & Southland, Hamilton City Council, Horowhenua District Council, Hutt City Council, Tauranga City Council, Waipa District Council, Wellington City Council |
|
||||
| Norway | BIR (Bergensområdets Interkommunale Renovasjonsselskap), IRiS, Min Renovasjon, Movar IKS, Oslo Kommune, ReMidt Orkland muni, Sandnes Kommune, Stavanger Kommune, Trondheim |
|
||||
| Poland | Ecoharmonogram, Poznań/Koziegłowy/Objezierze/Oborniki, Warsaw, Wrocław |
|
||||
| Poland | Ecoharmonogram, Gmina Miękinia, Poznań/Koziegłowy/Objezierze/Oborniki, Warsaw, Wrocław |
|
||||
| Slovenia | Moji odpadki, Ljubljana |
|
||||
| Sweden | Affärsverken, Gästrike Återvinnare, Jönköping - June Avfall & Miljö, Landskrona - Svalövs Renhållning, Lerum Vatten och Avlopp, Linköping - Tekniska Verken, Lund Waste Collection, North / Middle Bohuslän - Rambo AB, Region Gotland, Ronneby Miljöteknik, Samverkan Återvinning Miljö (SÅM), SRV Återvinning, SSAM, Sysav Sophämntning, Uppsala Vatten och Avfall AB, VA Syd Sophämntning, VIVAB Sophämtning |
|
||||
| Switzerland | A-Region, Alchenstorf, Andwil, Appenzell, Berg, Bühler, Canton of Zürich, Eggersriet, Gais, Gaiserwald, Goldach, Grosswangen, Grub, Heiden, Herisau, Horn, Hundwil, Häggenschwil, Lindau, Lutzenberg, Muolen, Mörschwil, Münchenstein, Münsingen BE, Switzerland, Real Luzern, Rehetobel, Rorschach, Rorschacherberg, Schwellbrunn, Schönengrund, Speicher, Stein, Steinach, Teufen, Thal, Trogen, Tübach, Untereggen, Urnäsch, Wald, Waldkirch, Waldstatt, Wittenbach, Wolfhalden |
|
||||
|
||||
Reference in New Issue
Block a user