iobroker.ring 3.4.1 → 5.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -21,7 +21,7 @@ After installing the Adapter you have to enter your Email and Password of your [
21
21
  a Token. Ring now requires the use of Two-Factor Auth (2fa) for all accounts. For getting the token please do following
22
22
  on your shell.
23
23
 
24
- ```
24
+ ```shell
25
25
  npx -p ring-client-api ring-auth-cli
26
26
  ```
27
27
 
@@ -88,6 +88,25 @@ doorbell recorded video.
88
88
  Placeholder for the next version (at the beginning of the line):
89
89
  ### **WORK IN PROGRESS**
90
90
  -->
91
+ ### 5.0.0-alpha.0 (2023-09-16)
92
+
93
+ * (crocri) Ding event is now working again for Ring-Intercom
94
+ * (crocri) auto livestream creation takes now value from config, before fix
95
+ * (crocri) snapshot now async, because snapshot and livestream in parallel does not work
96
+ * (crocri) livestream duration now settable via tree entry will be auto reset via livestream request.
97
+ * (crocri) two new config entries auto_livestream and auto_snapshot to disable auto creation of livestream and snapshot.
98
+ * (crocri) some minor corrections to code
99
+ * (crocri) Removed binary States
100
+ * (crocri) Improvements for vis compatibility
101
+ * (theimo1221) Refactoring and cleanup
102
+ * (theimo1221) Update Packages
103
+
104
+ ### 4.0.0 (2023-08-22)
105
+
106
+ * (theimo1221) !!Breaking Change!! From now on Node 18 or 20 is required, Node 16 is not supported anymore
107
+ * (theimo1221) Update Ring-Api to V12 which needs Node 18 or 20
108
+ * (theimo1221) Update Packages
109
+
91
110
  ### 3.4.1 (2023-08-06)
92
111
 
93
112
  * (theimo1221) Compliance to adapter-checker
Binary file
Binary file
@@ -18,72 +18,72 @@
18
18
  <script type="text/javascript" src="words.js"></script>
19
19
 
20
20
  <script type="text/javascript">
21
- var secret = null;
21
+ var secret = null;
22
22
 
23
- function encrypt(key, value) {
24
- var result = '';
25
- for (var i = 0; i < value.length; ++i) {
26
- result += String.fromCharCode(key[i % key.length].charCodeAt(0) ^ value.charCodeAt(i));
23
+ function encrypt(key, value) {
24
+ var result = '';
25
+ for (var i = 0; i < value.length; ++i) {
26
+ result += String.fromCharCode(key[i % key.length].charCodeAt(0) ^ value.charCodeAt(i));
27
+ }
28
+ return result;
27
29
  }
28
- return result;
29
- }
30
30
 
31
- function decrypt(key, value) {
31
+ function decrypt(key, value) {
32
32
 
33
- var result = '';
34
- for (var i = 0; i < value.length; ++i) {
35
- result += String.fromCharCode(key[i % key.length].charCodeAt(0) ^ value.charCodeAt(i));
36
- }
37
- return result;
38
- }
39
-
40
- // This will be called by the admin adapter when the settings page loads
41
- function load(settings, onChange) {
42
- // example: select elements with id=key and class=value and insert value
43
- if (!settings) return;
44
- secret = (systemConfig.native ? systemConfig.native.secret : '') || 'Zgfr56gFe87jJOM';
45
-
46
- $('.value').each(function () {
47
- var $key = $(this);
48
- var id = $key.attr('id');
49
- if ($key.attr('type') === 'checkbox') {
50
- // do not call onChange direct, because onChange could expect some arguments
51
- $key.prop('checked', settings[id])
52
- .on('change', () => onChange())
53
- ;
54
- } else {
55
- var value = settings[id];
56
- if (value && $key.attr('data-crypt') == "1") {
57
- value = decrypt(secret, value);
33
+ var result = '';
34
+ for (var i = 0; i < value.length; ++i) {
35
+ result += String.fromCharCode(key[i % key.length].charCodeAt(0) ^ value.charCodeAt(i));
58
36
  }
59
- // do not call onChange direct, because onChange could expect some arguments
60
- $key.val(value)
61
- .on('change', () => onChange())
62
- .on('keyup', () => onChange())
63
- ;
64
- }
65
- });
66
- onChange(false);
67
- // reinitialize all the Materialize labels on the page if you are dynamically adding inputs:
68
- if (M) M.updateTextFields();
69
- }
70
-
71
- // This will be called by the admin adapter when the user presses the save button
72
- function save(callback) {
73
- // example: select elements with class=value and build settings object
74
- var obj = {};
75
- $('.value').each(function () {
76
- var $this = $(this);
77
- if ($this.attr('type') === 'checkbox') {
78
- obj[$this.attr('id')] = $this.prop('checked');
79
- } else if ($this.attr('type') === 'number') {
80
- obj[$this.attr('id')] = parseFloat($this.val());
81
- } else {
82
- obj[$this.attr('id')] = $this.data('crypt') && $this.val() ? encrypt(secret, $this.val()) : $this.val();
83
- }
84
- });
85
- callback(obj);
86
- }
37
+ return result;
38
+ }
39
+
40
+ // This will be called by the admin adapter when the settings page loads
41
+ function load(settings, onChange) {
42
+ // example: select elements with id=key and class=value and insert value
43
+ if (!settings) return;
44
+ secret = (systemConfig.native ? systemConfig.native.secret : '') || 'Zgfr56gFe87jJOM';
45
+
46
+ $('.value').each(function () {
47
+ var $key = $(this);
48
+ var id = $key.attr('id');
49
+ if ($key.attr('type') === 'checkbox') {
50
+ // do not call onChange direct, because onChange could expect some arguments
51
+ $key.prop('checked', settings[id])
52
+ .on('change', () => onChange())
53
+ ;
54
+ } else {
55
+ var value = settings[id];
56
+ if (value && $key.attr('data-crypt') == "1") {
57
+ value = decrypt(secret, value);
58
+ }
59
+ // do not call onChange direct, because onChange could expect some arguments
60
+ $key.val(value)
61
+ .on('change', () => onChange())
62
+ .on('keyup', () => onChange())
63
+ ;
64
+ }
65
+ });
66
+ onChange(false);
67
+ // reinitialize all the Materialize labels on the page if you are dynamically adding inputs:
68
+ if (M) M.updateTextFields();
69
+ }
70
+
71
+ // This will be called by the admin adapter when the user presses the save button
72
+ function save(callback) {
73
+ // example: select elements with class=value and build settings object
74
+ var obj = {};
75
+ $('.value').each(function () {
76
+ var $this = $(this);
77
+ if ($this.attr('type') === 'checkbox') {
78
+ obj[$this.attr('id')] = $this.prop('checked');
79
+ } else if ($this.attr('type') === 'number') {
80
+ obj[$this.attr('id')] = parseFloat($this.val());
81
+ } else {
82
+ obj[$this.attr('id')] = $this.data('crypt') && $this.val() ? encrypt(secret, $this.val()) : $this.val();
83
+ }
84
+ });
85
+ callback(obj);
86
+ }
87
87
  </script>
88
88
 
89
89
  </head>
@@ -101,18 +101,28 @@
101
101
  <div class="row">
102
102
  <div class="col s12">
103
103
  <ul class="tabs">
104
- <li class="tab col s2"><a href="#tab-login" class="translate active">Login</a></li>
105
- <li class="tab col s2"><a href="#tab-snapshot" class="translate active">Snapshot</a></li>
104
+ <li class="tab col s2"><a href="#tab-login"><img src="preferences-system-login.png"
105
+ style="width: 5%; min-width: 50px;" title="Login"
106
+ alt="login" class="logo"></a></li>
107
+ <li class="tab col s2"><a href="#tab-snapshot"><img src="camera-photo-5.png"
108
+ style="width: 5%; min-width: 50px;" title="Snapshot"
109
+ alt="snapshot" class="logo"></a></li>
110
+ <li class="tab col s2"><a href="#tab-livestream"><img src="camera-video.png"
111
+ style="width: 5%; min-width: 50px;"
112
+ title="Livestream" alt="livestream" class="logo"></a>
113
+ </li>
106
114
  </ul>
107
115
  </div>
108
116
  </div>
109
117
  <div id="tab-login" class="col s12 page">
110
118
  <div class="row">
111
119
  <div class="col s12">
112
- <p class="translate">ringdescription</p>
120
+ <a href="https://github.com/iobroker-community-adapters/ioBroker.ring#install--configuration"
121
+ target="_blank">
122
+ <p class="translate">ringdescription</p>
123
+ </a>
113
124
  </div>
114
125
  </div>
115
-
116
126
  <div class="row">
117
127
  <!-- div class="input-field col s12">
118
128
  <input class="value" id="twofaceauth" type="checkbox" />
@@ -123,45 +133,65 @@
123
133
  <label class="translate" for="refreshtoken">Refreshtoken (Two Face Auth)</label>
124
134
  </div>
125
135
  </div>
126
-
127
136
  </div>
128
137
 
129
138
  <div id="tab-snapshot" class="col s12 page">
130
139
  <div class="row">
131
- <div class="input-field col s6">
132
- <img src="ring.png" class="logo">
140
+ <div class="input-field col s12 m6 l4">
141
+ <input class="value" id="auto_snapshot" type="checkbox"/>
142
+ <label for="auto_snapshot" class="translate">Auto event</label>
133
143
  </div>
134
144
  </div>
135
145
  <div class="row">
136
- <div class="col s12 m4 l1">
137
- <input class="value number" id="recordtime_livestream" min="0" max="60" type="number"/>
138
- <label class="translate" for="recordtime_livestream">Livestream recordtime in sec.</label>
146
+ <div class="input-field col s12 m6 l4">
147
+ <input id="path_snapshot" type="text" size="30" class="value"/>
148
+ <label class="translate" for="path_snapshot">Path</label>
139
149
  </div>
140
150
  </div>
141
151
  <div class="row">
142
152
  <div class="input-field col s12 m6 l4">
143
- <input id="path" type="text" size="30" class="value"/>
144
- <label class="translate" for="path">Path</label>
153
+ <input id="filename_snapshot" type="text" size="30" class="value"/>
154
+ <label class="translate" for="filename_snapshot">Filename</label>
155
+ <input class="value" id="del_old_snapshot" type="checkbox"/>
156
+ <label for="del_old_snapshot" class="translate">Delete old one</label>
145
157
  </div>
146
158
  </div>
159
+ </div>
160
+
161
+ <div id="tab-livestream" class="col s12 page">
147
162
  <div class="row">
148
163
  <div class="input-field col s12 m6 l4">
149
- <input id="filename_snapshot" type="text" size="30" class="value"/>
150
- <label class="translate" for="filename_snapshot">Filename Snapshot</label>
151
- <input class="value" id="del_old_snapshot" type="checkbox"/>
152
- <label for="del_old_snapshot" class="translate">Delete old Snapshots</label>
164
+ <input class="value" id="auto_livestream" type="checkbox"/>
165
+ <label for="auto_livestream" class="translate">Auto event</label>
153
166
  </div>
154
- <div class="row">
155
- <div class="input-field col s12 m6 l4">
156
- <input id="filename_livestream" type="text" size="30" class="value"/>
157
- <label class="translate" for="filename_livestream">Filename Livestream</label>
158
- <input class="value" id="del_old_livestream" type="checkbox"/>
159
- <label for="del_old_livestream" class="translate">Delete old Livestreams</label>
160
- </div>
167
+ </div>
168
+ <div class="row">
169
+ <div class="input-field col s12 m6 l4">
170
+ <input class="value number" id="recordtime_auto_livestream" min="0" max="60" type="number"/>
171
+ <label class="translate" for="recordtime_auto_livestream">Automatic recording time in seconds</label>
172
+ </div>
173
+ </div>
174
+ <div class="row">
175
+ <div class="input-field col s12 m6 l4">
176
+ <input class="value number" id="recordtime_livestream" min="0" max="60" type="number"/>
177
+ <label class="translate" for="recordtime_livestream">Recording time in seconds</label>
178
+ </div>
179
+ </div>
180
+ <div class="row">
181
+ <div class="input-field col s12 m6 l4">
182
+ <input id="path_livestream" type="text" size="30" class="value"/>
183
+ <label class="translate" for="path_livestream">Path</label>
184
+ </div>
185
+ </div>
186
+ <div class="row">
187
+ <div class="input-field col s12 m6 l4">
188
+ <input id="filename_livestream" type="text" size="30" class="value"/>
189
+ <label class="translate" for="filename_livestream">Filename</label>
190
+ <input class="value" id="del_old_livestream" type="checkbox"/>
191
+ <label for="del_old_livestream" class="translate">Delete old one</label>
161
192
  </div>
162
193
  </div>
163
194
  </div>
164
-
165
195
  </div>
166
196
 
167
197
  </body>
package/admin/style.css CHANGED
@@ -12,6 +12,7 @@
12
12
  height: 100%;
13
13
  width: 100%;
14
14
  position: relative;
15
+ padding: 10px;
15
16
  }
16
17
  .m .select-wrapper + label {
17
18
  /* The positioning for dropdown labels is messed up */