Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added http API for abfall.io #286

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ iobroker add trashschedule
Placeholder for the next version (at the beginning of the line):
### **WORK IN PROGRESS**
-->

### **WORK IN PROGRESS**
* (@jey-cee) Added http API for abfall.io

### 3.4.0 (2024-11-07)

* (@klein0r) Validate user inputs in instance configuration
Expand Down
6 changes: 3 additions & 3 deletions admin/jsonConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
},
"apiAbfallioDistrictId": {
"newLine": true,
"hidden": "!data.apiAbfallioProvider || data.apiAbfallioProvider === 'err' || !data.apiAbfallioCityId || data.apiAbfallioCityId === 'err'",
"hidden": "!data.apiAbfallioProvider || data.apiAbfallioProvider === 'err' || !data.apiAbfallioCityId || data.apiAbfallioCityId === 'err' ",
"type": "autocompleteSendTo",
"command": "getApiDistricts",
"jsonData": "{\"source\": \"api-abfallio\", \"provider\": \"${data.apiAbfallioProvider}\", \"cityId\": \"${data.apiAbfallioCityId}\"}",
Expand Down Expand Up @@ -268,7 +268,7 @@
},
"apiAbfallioHouseNumber": {
"newLine": true,
"hidden": "!data.apiAbfallioProvider || data.apiAbfallioProvider === 'err' || !data.apiAbfallioCityId || data.apiAbfallioCityId === 'err' || !data.apiAbfallioDistrictId || data.apiAbfallioDistrictId === 'err' || !data.apiAbfallioStreetId || data.apiAbfallioStreetId === 'err'",
"hidden": "!data.apiAbfallioProvider || data.apiAbfallioProvider === 'err' || !data.apiAbfallioCityId || data.apiAbfallioCityId === 'err' || !data.apiAbfallioDistrictId || data.apiAbfallioDistrictId === 'err' || !data.apiAbfallioStreetId || data.apiAbfallioStreetId === 'err' || (Array.isArray(data.apiAbfallioStreetId) ? data.apiAbfallioStreetId.some(item => item.label === 'alle Straßen') : data.apiAbfallioStreetId === 'alle Straßen')",
"type": "autocompleteSendTo",
"command": "getApiHouseNumbers",
"jsonData": "{\"source\": \"api-abfallio\", \"provider\": \"${data.apiAbfallioProvider}\", \"cityId\": \"${data.apiAbfallioCityId}\", \"districtId\": \"${data.apiAbfallioDistrictId}\", \"streetId\": \"${data.apiAbfallioStreetId}\"}",
Expand All @@ -290,7 +290,7 @@
"container": "text",
"copyToClipboard": true,
"command": "getApiTypesText",
"jsonData": "{\"source\": \"api-abfallio\", \"provider\": \"${data.apiAbfallioProvider}\", \"cityId\": \"${data.apiAbfallioCityId}\", \"houseNumber\": \"${data.apiAbfallioHouseNumber}\"}",
"jsonData": "{\"source\": \"api-abfallio\", \"provider\": \"${data.apiAbfallioProvider}\", \"cityId\": \"${data.apiAbfallioCityId}\", \"streetId\": \"${data.apiAbfallioStreetId}\", \"houseNumber\": \"${data.apiAbfallioHouseNumber}\"}",
"alsoDependsOn": [
"apiAbfallioProvider",
"apiAbfallioCityId",
Expand Down
131 changes: 119 additions & 12 deletions lib/provider/api-abfallio.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
'use strict';

module.exports = {
/*
egst: {
title: 'EGST Steinfurt',
url: 'https://www.egst.de/',
apiKey: 'e21758b9c711463552fb9c70ac7d4273',
api: 'httpApi',
},
alba: {
title: 'ALBA Berlin',
url: 'https://berlin.alba.info/',
apiKey: '9583a2fa1df97ed95363382c73b41b1b',
api: 'httpApi',
},
aso: {
title: 'ASO Abfall-Service Osterholz',
url: 'https://www.aso-ohz.de/',
apiKey: '040b38fe83f026f161f30f282b2748c0',
api: 'httpApi',
},
bayreuth: {
title: 'Landkreis Bayreuth',
url: 'https://www.landkreis-bayreuth.de/',
apiKey: 'd113742756399052aceb26d2c312a891cee5455767a991fc',
api: 'graphQl',
},
*/
boeblingen: {
title: 'Abfallwirtschaft Landkreis Böblingen',
url: 'https://www.awb-bb.de',
Expand Down Expand Up @@ -51,103 +57,204 @@ module.exports = {
'Weissach',
],
apiKey: 'caac1d0b40973ad8ed652ef666ab7336fd50eede75ff868d',
api: 'graphQl',
},
/*
calw: {
title: 'Landkreis Calw',
url: 'https://www.awg-info.de/privatkunden/abfuhrtermine',
apiKey: '690a3ae4906c52b232c1322e2f88550c',
api: 'httpApi',
},
essen: {
title: 'Entsorgungsbetriebe Essen',
url: 'https://www.ebe-essen.de/',
apiKey: 'MTEwYzI4ODMtNmMzOC00MTlkLTkzZTUtZDJhYjUxNTUwYzk1OjU4NDM',
api: 'graphQl',
},
freudenstadt: {
/*freudenstadt: {
title: 'Abfallwirtschaft Landkreis Freudenstadt',
url: 'https://www.awb-fds.de/',
},
apiKey: '',
api: '',
},*/
goeppingen: {
title: 'AWB Landkreis Göppingen',
url: 'https://www.awb-gp.de/',
apiKey: '3182d305647e50dbe6a90f5815aeb5a1',
api: 'httpApi',
},
goettingen: {
/*goettingen: {
title: 'Göttinger Entsorgungsbetriebe',
url: 'https://www.geb-goettingen.de/',
},
apiKey: '',
api: '',
},*/
heilbronn: {
title: 'Landkreis Heilbronn',
url: 'https://www.landkreis-heilbronn.de/',
url: 'https://www.aw-landkreis-heilbronn.de/',
apiKey: '18adb00cb5135f6aa16b5fdea6dae2c63a507ae0f836540e',
api: 'graphQl',
},
kitzingen: {
title: 'Abfallwirtschaft Landkreis Kitzingen',
url: 'https://www.abfallwelt.de/',
apiKey: '594f805eb33677ad5bc645aeeeaf2623',
api: 'httpApi',
},
landsberg: {
title: 'Abfallwirtschaft Landkreis Landsberg am Lech',
url: 'https://www.abfallberatung-landsberg.de/',
apiKey: '7df877d4f0e63decfb4d11686c54c5d6',
api: 'httpApi',
},
landshut: {
title: 'Stadt Landshut',
url: 'https://www.landshut.de/',
apiKey: 'bd0c2d0177a0849a905cded5cb734a6f',
api: 'httpApi',
},
ludwigshafen: {
title: 'Ludwigshafen am Rhein',
url: 'https://www.ludwigshafen.de/',
apiKey: '6efba91e69a5b454ac0ae3497978fe1d',
api: 'httpApi',
},
muellalarm: {
title: 'MüllALARM / Schönmackers',
url: 'https://www.schoenmackers.de/',
apiKey: 'e5543a3e190cb8d91c645660ad60965f',
api: 'httpApi',
},
ortenaukreis: {
title: 'Abfallwirtschaft Ortenaukreis',
url: 'https://www.abfallwirtschaft-ortenaukreis.de/',
apiKey: 'bb296b78763112266a391990f803f032',
api: 'httpApi',
},
ostalbkreis: {
title: 'Abfallbewirtschaftung Ostalbkreis',
url: 'https://www.goa-online.de/',
apiKey: '3ca331fb42d25e25f95014693ebcf855',
api: 'httpApi',
},
ostallgäu: {
ostallgaeu: {
title: 'Landkreis Ostallgäu',
url: 'https://www.buerger-ostallgaeu.de/',
apiKey: '342cedd68ca114560ed4ca4b7c4e5ab6',
api: 'httpApi',
},
rheinneckar: {
title: 'Rhein-Neckar-Kreis',
url: 'https://www.rhein-neckar-kreis.de/',
apiKey: '914fb9d000a9a05af4fd54cfba478860',
api: 'httpApi',
},
rotenburg: {
title: 'Landkreis Rotenburg (Wümme)',
url: 'https://lk-awr.de/',
apiKey: '645adb3c27370a61f7eabbb2039de4f1',
api: 'httpApi',
},
sigmaringen: {
title: 'Landkreis Sigmaringen',
url: 'https://www.landkreis-sigmaringen.de/',
apiKey: '8e2d42fc9e1604a53af1499fad35f3a9',
api: 'httpApi',
},
traunstein: {
title: 'Landratsamt Traunstein',
url: 'https://www.traunstein.com/',
apiKey: '64bc012302ebd3e6bbc767ae6bd5746f57649ca676fa78da',
api: 'graphQl',
},
unterallgaeu: {
title: 'Landratsamt Unterallgäu',
url: 'https://www.landratsamt-unterallgaeu.de/',
cities: [
'Amberg',
'Apfeltrach',
'Babenhausen',
'Bad Grönenbach',
'Bad Wörishofen',
'Benningen',
'Böhen',
'Boos',
'Breitenbrunn',
'Buxheim',
'Dirlewang',
'Egg an der Günz',
'Eppishausen',
'Erkheim',
'Ettringen',
'Fellheim',
'Hawangen',
'Heimertingen',
'Holzgünz',
'Kammlach',
'Kettershausen',
'Kirchhaslach',
'Kirchheim',
'Kronburg',
'Lachen',
'Lauben',
'Lautrach',
'Legau',
'Markt Rettenbach',
'Markt Wald',
'Memmingerberg',
'Mindelheim',
'Niederrieden',
'Oberrieden',
'Oberschönegg',
'Ottobeuren',
'Pfaffenhausen',
'Pleß',
'Rammingen',
'Salgen',
'Sontheim',
'Stetten',
'Trunkelsberg',
'Türkheim',
'Tussenhausen',
'Ungerhausen',
'Unteregg',
'Westerheim',
'Wiedergeltingen',
'Winterrieden',
'Wolfertschwenden',
'Woringen',
],
apiKey: 'd7f2f6a9abb738ae33fba06696f73ddd',
api: 'httpApi',
},
westerwald: {
title: 'AWB Westerwaldkreis',
url: 'https://wab.rlp.de/',
apiKey: '248deacbb49b06e868d29cb53c8ef034',
api: 'httpApi',
},
limburg: {
title: 'Landkreis Limburg-Weilburg',
url: 'https://www.awb-lm.de/',
apiKey: '0ff491ffdf614d6f34870659c0c8d917',
api: 'httpApi',
},
weissenburg: {
title: 'Landkreis Weißenburg-Gunzenhausen',
url: 'https://www.landkreis-wug.de',
apiKey: '31fb9c7d783a030bf9e4e1994c7d2a91',
api: 'httpApi',
},
vivq: {
/*vivq: {
title: 'VIVO Landkreis Miesbach',
url: 'https://www.vivowarngau.de/',
},
apiKey: '',
api: '',
},*/
mayen: {
title: 'Abfallzweckverband Rhein-Mosel-Eifel (Landkreis Mayen-Koblenz)',
url: 'https://www.azv-rme.de/',
apiKey: 'e62c1c1e8fea71cfe0304d0cb893b1d03a2af1091fc024b1',
api: 'graphQl',
},
*/
};
Loading