Skip to content

Commit

Permalink
fixed #147
Browse files Browse the repository at this point in the history
  • Loading branch information
misanorot committed Sep 19, 2023
1 parent da202eb commit 3960c9c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
Placeholder for the next version (at the beginning of the line):
### **WORK IN PROGRESS**
-->
### **WORK IN PROGRESS**
* (misanorot) fixed #147

### 3.3.12 (2023-06-23)
* (misanorot) fixed select-id popup and little issues on setting pages

Expand Down
12 changes: 8 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,10 @@ class Alarm extends utils.Adapter {
burglary(id, _state, silent, indoor) {
let count = 0;
const name = this.get_name(id);
let say = this.config.text_alarm;
if (this.config.opt_say_names) {
say = say + ' ' + name;
}
if (burgle) {
this.setState('info.log', `${this.config.log_burgle} ${name}`, true);
if (log) this.log.info(`${this.config.log_burgle} ${name}`);
Expand Down Expand Up @@ -359,10 +363,10 @@ class Alarm extends utils.Adapter {
if (this.config.send_alarm) this.messages(`${this.config.log_burgle} ${name}`);
clearTimeout(silent_timer);
clearInterval(silent_interval);
this.sayit(this.config.text_alarm, 6);
this.sayit(say, 6);
text_alarm_interval = setInterval(() => {
if (count < alarm_repeat) {
this.sayit(this.config.text_alarm, 6);
this.sayit(say, 6);
count++;
} else {
clearInterval(text_alarm_interval);
Expand Down Expand Up @@ -397,10 +401,10 @@ class Alarm extends utils.Adapter {
this.clearAllPresenceTimer();
if (this.config.send_alarm_inside && indoor) this.messages(`${this.config.log_burgle} ${name}`);
if (this.config.send_alarm && !indoor) this.messages(`${this.config.log_burgle} ${name}`);
this.sayit(this.config.text_alarm, 6);
this.sayit(say, 6);
text_alarm_interval = setInterval(() => {
if (count < alarm_repeat) {
this.sayit(this.config.text_alarm, 6);
this.sayit(say, 6);
count++;
} else {
clearInterval(text_alarm_interval);
Expand Down

0 comments on commit 3960c9c

Please sign in to comment.