Skip to content

Commit

Permalink
Fixed some issues
Browse files Browse the repository at this point in the history
  • Loading branch information
robertraaijmakers committed Feb 5, 2025
1 parent 05cf1dd commit e4625ab
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .homeychangelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
"en": "Updated APIs for new year. Notice: your municipality might have changed from provider/API and you might need to reconfigure the app.",
"nl": "APIs waar nodig bijgewerkt voor het nieuwe jaar. Let op: het kan zijn dat je gemeente van API gewijzigd is en je zaken opnieuw moet instellen!"
},
"5.0.6": {
"5.0.9": {
"en": "Complete rebuild of the app based on new development best practices from Athom.",
"nl": "De app is volledig opnieuw opgebouwd om nog meer APIs te kunnen ondersteunen in de toekomst."
}
Expand Down
2 changes: 1 addition & 1 deletion .homeycompose/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"nl": "Afval Herinnering 2.0",
"sv": "Avfallspåminnelse 2.0"
},
"version": "5.0.6",
"version": "5.0.9",
"platforms": [
"local"
],
Expand Down
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"nl": "Afval Herinnering 2.0",
"sv": "Avfallspåminnelse 2.0"
},
"version": "5.0.6",
"version": "5.0.9",
"platforms": [
"local"
],
Expand Down
36 changes: 18 additions & 18 deletions app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -601,29 +601,29 @@ module.exports = class TrashCollectionReminder extends Homey.App {
const labelSettings: LabelSettings = {
timeindicator: oldLabelSettings.timeindicator,
generic: oldLabelSettings.generic,
GFT: { trashLong: oldLabelSettings.gft },
REST: { trashLong: oldLabelSettings.rest },
PMD: { trashLong: oldLabelSettings.pmd },
PLASTIC: { trashLong: oldLabelSettings.plastic },
PAPIER: { trashLong: oldLabelSettings.papier },
TEXTIEL: { trashLong: oldLabelSettings.textiel },
GROF: { trashLong: oldLabelSettings.grof },
GLAS: { trashLong: oldLabelSettings.glas },
KERSTBOOM: { trashLong: oldLabelSettings.kerstboom },
NONE: { trashLong: oldLabelSettings.none },
GFT: { trashLong: oldLabelSettings?.gft || this.homey.__('tokens.output.type.GFT') },
REST: { trashLong: oldLabelSettings?.rest || this.homey.__('tokens.output.type.REST') },
PMD: { trashLong: oldLabelSettings?.pmd || this.homey.__('tokens.output.type.PMD') },
PLASTIC: { trashLong: oldLabelSettings?.plastic || this.homey.__('tokens.output.type.PLASTIC') },
PAPIER: { trashLong: oldLabelSettings?.papier || this.homey.__('tokens.output.type.PAPIER') },
TEXTIEL: { trashLong: oldLabelSettings?.textiel || this.homey.__('tokens.output.type.TEXTIEL') },
GROF: { trashLong: oldLabelSettings?.grof || this.homey.__('tokens.output.type.GROF') },
GLAS: { trashLong: oldLabelSettings?.glas || this.homey.__('tokens.output.type.GLAS') },
KERSTBOOM: { trashLong: oldLabelSettings?.kerstboom || this.homey.__('tokens.output.type.KERSTBOOM') },
NONE: { trashLong: oldLabelSettings?.none || this.homey.__('tokens.output.type.NONE') },
};

this.homey.settings.set('labelSettings', labelSettings);

const manualSettings: ManualSettings = {
GFT: oldManualSettings.gft,
PLASTIC: oldManualSettings.plastic,
PAPIER: oldManualSettings.paper,
PMD: oldManualSettings.pmd,
REST: oldManualSettings.rest,
TEXTIEL: oldManualSettings.textile,
GROF: oldManualSettings.bulky,
GLAS: oldManualSettings.glas,
GFT: oldManualSettings?.gft,
PLASTIC: oldManualSettings?.plastic,
PAPIER: oldManualSettings?.paper,
PMD: oldManualSettings?.pmd,
REST: oldManualSettings?.rest,
TEXTIEL: oldManualSettings?.textile,
GROF: oldManualSettings?.bulky,
GLAS: oldManualSettings?.glas,
};

this.homey.settings.set('manualEntryData', manualSettings);
Expand Down
4 changes: 3 additions & 1 deletion lib/trashapis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,9 @@ export class TrashApis {
break;
}

addDate(fDates, key, o[i].dates);
for (let index in o[i].dates) {
addDate(fDates, key, new Date(o[i].dates[index]));
}
}

return fDates;
Expand Down
12 changes: 6 additions & 6 deletions test/trashApiTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,9 @@ describe('TrashApiRd4', function () {
assert.equal(isValid, true);
});
});
*/
describe('TrashApiAfw', function () {
/*it('API - Mijn Afvalwijzer (1)', async function () {
it('API - Mijn Afvalwijzer (1)', async function () {
const apiSettings: ApiSettings = {
zipcode: '9821TT',
housenumber: '9',
Expand Down Expand Up @@ -487,7 +487,7 @@ describe('TrashApiAfw', function () {
const isValid = validateApiResults(apiSettings, result);
assert.equal(isValid, true);
});
*/
it('API - Afvalwijzer - Den Bosch', async function () {
const apiSettings: ApiSettings = {
zipcode: '5231PB',
Expand All @@ -503,7 +503,7 @@ describe('TrashApiAfw', function () {
assert.equal(isValid, true);
});
});
/*
describe('TrashApiAknw', function () {
it('API - Nissewaard', async function () {
const apiSettings: ApiSettings = {
Expand Down Expand Up @@ -604,7 +604,7 @@ describe('TrashApiMba', function () {
const isValid = validateApiResults(apiSettings, result);
assert.equal(isValid, true);
});
});
});*/

describe('TrashApiAcb', function () {
it('API - Circulus Berkel', async function () {
Expand Down Expand Up @@ -637,7 +637,7 @@ describe('TrashApiAcb', function () {
assert.equal(isValid, true);
});
});
/*
describe('TrashApiAfa', function () {
it('API - Afval App', async function () {
const apiSettings: ApiSettings = {
Expand Down

0 comments on commit e4625ab

Please sign in to comment.