Skip to content

Commit

Permalink
- Bug fix for the 'Holiday today' / 'Not a holiday today' action
Browse files Browse the repository at this point in the history
- Added 'Use automatic holiday' action to go back to automatic holidays
  • Loading branch information
balmli committed Dec 10, 2022
1 parent ab97743 commit 4b948e5
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .homeychangelog.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"1.11.1": {
"en": "Bug fix for the 'Holiday today' / 'Not a holiday today' action. Added 'Use automatic holiday' action to go back to automatic holidays. "
},
"1.11.0": {
"en": "Added 'Price level' tag on 'Utility price changed' trigger. "
},
Expand Down
2 changes: 1 addition & 1 deletion .homeycompose/app.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "no.almli.heatingcontroller",
"version": "1.11.0",
"version": "1.11.1",
"compatibility": ">=5.0.0",
"sdk": 3,
"brandColor": "#d06830",
Expand Down
19 changes: 19 additions & 0 deletions .homeycompose/flow/actions/clear_holiday_today.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"id": "clear_holiday_today",
"title": {
"en": "Use automatic holiday"
},
"titleFormatted": {
"en": "Use automatic holiday"
},
"hint": {
"en": "Use this action to go back to heating controller's automatic holiday setting, if it was previously set to manual by the 'Holiday today' / 'Not a holiday today' action."
},
"args": [
{
"type": "device",
"name": "device",
"filter": "driver_id=HeatingController"
}
]
}
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ Please report issues on the [community forum page](https://community.homey.app/t

### Release Notes:

#### 1.11.1

- Bug fix for the 'Holiday today' / 'Not a holiday today' action
- Added 'Use automatic holiday' action to go back to automatic holidays

#### 1.11.0

- Added 'Price level' tag on 'Utility price changed' trigger
Expand Down
5 changes: 4 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ class HeatingControllerApp extends Homey.App {
.registerRunListener((args, state) => args.device.onActionSetHomeOverrideOff());

this.homey.flow.getActionCard('set_holiday_today')
.registerRunListener((args, state) => args.device.onActionSetHolidayToday());
.registerRunListener((args, state) => args.device.onActionSetHolidayToday(args));

this.homey.flow.getActionCard('clear_holiday_today')
.registerRunListener((args, state) => args.device.onActionClearHolidayToday());
}

check(args, types) {
Expand Down
21 changes: 20 additions & 1 deletion app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"_comment": "This file is generated. Please edit .homeycompose/app.json instead.",
"id": "no.almli.heatingcontroller",
"version": "1.11.0",
"version": "1.11.1",
"compatibility": ">=5.0.0",
"sdk": 3,
"brandColor": "#d06830",
Expand Down Expand Up @@ -1941,6 +1941,25 @@
}
],
"actions": [
{
"id": "clear_holiday_today",
"title": {
"en": "Use automatic holiday"
},
"titleFormatted": {
"en": "Use automatic holiday"
},
"hint": {
"en": "Use this action to go back to heating controller's automatic holiday setting, if it was previously set to manual by the 'Holiday today' / 'Not a holiday today' action."
},
"args": [
{
"type": "device",
"name": "device",
"filter": "driver_id=HeatingController"
}
]
},
{
"id": "set_at_home_off",
"title": {
Expand Down
7 changes: 6 additions & 1 deletion drivers/HeatingController/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,16 @@ module.exports = class HeatingControllerDevice extends Homey.Device {
return this.checkTime({ home_override: false});
}

async onActionSetHolidayToday() {
async onActionSetHolidayToday(args) {
await this.setSettings({ holiday_today: args.holiday }).catch(this.error);
return this.checkTime();
}

async onActionClearHolidayToday() {
await this.setSettings({ holiday_today: '' }).catch(this.error);
return this.checkTime();
}

onAdded() {
this.log(this.getName() + ' -> device added', this.getData().id);
}
Expand Down

0 comments on commit 4b948e5

Please sign in to comment.