Skip to content

Commit

Permalink
Updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
klein0r committed Apr 23, 2024
1 parent 4666bd9 commit 0e52974
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 41 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ iobroker add birthdays

NodeJS >= 18.x and js-controller >= 5 is required

* (klein0r) Added weekday to all birthdays

### 2.4.1 (2023-10-30)

* (klein0r) Added warnings if birthday event is not recurring
Expand Down
27 changes: 26 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ class Birthdays extends utils.Adapter {

for (const birthdayObj of this.birthdays) {
const cleanName = this.cleanNamespace(birthdayObj.name);
const monthPath = this.getMonthPath(birthdayObj._birthday.month() + 1) + '.' + cleanName;
const monthPath = `${this.getMonthPath(birthdayObj._birthday.month() + 1)}.${cleanName}`;

keepBirthdays.push(monthPath);

Expand Down Expand Up @@ -653,6 +653,31 @@ class Birthdays extends utils.Adapter {
native: {},
});
await this.setStateChangedAsync(`${path}.daysLeft`, { val: birthdayObj.daysLeft, ack: true });

await this.setObjectNotExistsAsync(`${path}.nextWeekday`, {
type: 'state',
common: {
name: {
en: 'Weekday',
de: 'Woche',
ru: 'День недели',
pt: 'Dia de semana',
nl: 'Weekdag',
fr: 'Jour de semaine',
it: 'Rassegna',
es: 'Día de semana',
pl: 'Weekend',
uk: 'День народження',
'zh-cn': '工作日',
},
type: 'number',
role: 'value',
read: true,
write: false,
},
native: {},
});
await this.setStateChangedAsync(`${path}.nextWeekday`, { val: birthdayObj.daysLeft, ack: true });
}

getMonthPath(m) {
Expand Down
70 changes: 35 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@
"node": ">=18"
},
"dependencies": {
"@iobroker/adapter-core": "^3.0.6",
"@iobroker/adapter-core": "^3.1.4",
"axios": "^1.6.8",
"ical.js": "^1.5.0",
"ical.js": "^2.0.1",
"moment": "^2.30.1"
},
"devDependencies": {
"@alcalzone/release-script": "^3.7.0",
"@alcalzone/release-script-plugin-iobroker": "^3.7.0",
"@alcalzone/release-script-plugin-license": "^3.7.0",
"@iobroker/adapter-dev": "^1.3.0",
"@iobroker/testing": "^4.1.1",
"@iobroker/testing": "^4.1.3",
"@types/chai": "^4.3.14",
"@types/chai-as-promised": "^7.1.8",
"@types/mocha": "^10.0.6",
"@types/node": "^20.12.2",
"@types/node": "^20.12.7",
"@types/proxyquire": "^1.3.31",
"@types/sinon": "^17.0.3",
"@types/sinon-chai": "^3.2.12",
Expand All @@ -52,7 +52,7 @@
"proxyquire": "^2.1.3",
"sinon": "^17.0.1",
"sinon-chai": "^3.7.0",
"typescript": "~5.4.3"
"typescript": "~5.4.5"
},
"main": "main.js",
"files": [
Expand Down

0 comments on commit 0e52974

Please sign in to comment.