homematic-manager 3.0.0-beta.19 → 3.0.0-beta.20

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.
Files changed (176) hide show
  1. package/data/icons/106_hm-lc-sw1-dr.webp +0 -0
  2. package/data/icons/108_hm-rc-dis-h-x-eu.webp +0 -0
  3. package/data/icons/109_hm-lc-sw1-pl-ct.webp +0 -0
  4. package/data/icons/110_hm-es-pmsw1-dr.webp +0 -0
  5. package/data/icons/112_hmip-wrc2.webp +0 -0
  6. package/data/icons/113_hmip-psm-ch.webp +0 -0
  7. package/data/icons/113_hmip-psm-it.webp +0 -0
  8. package/data/icons/113_hmip-psm-pe.webp +0 -0
  9. package/data/icons/113_hmip-psm-uk.webp +0 -0
  10. package/data/icons/113_hmip-psm.webp +0 -0
  11. package/data/icons/114_hm-lc-dim1t-fm-lf_3.webp +0 -0
  12. package/data/icons/116_hm-rc-4-3_brc-h3.webp +0 -0
  13. package/data/icons/118_hmip-swdo.webp +0 -0
  14. package/data/icons/119_hmip-rc8.webp +0 -0
  15. package/data/icons/120_hmip-etrv.webp +0 -0
  16. package/data/icons/121_hmip-wth.webp +0 -0
  17. package/data/icons/123_oligo.smart.ip.hm.webp +0 -0
  18. package/data/icons/125_hmip-smi.webp +0 -0
  19. package/data/icons/130_hmip-srh.webp +0 -0
  20. package/data/icons/131_hmip-wrc6.webp +0 -0
  21. package/data/icons/132_hmip-smo.webp +0 -0
  22. package/data/icons/133_hmip-asir.webp +0 -0
  23. package/data/icons/134_hmip-fsm.webp +0 -0
  24. package/data/icons/135_hmip-fsm16.webp +0 -0
  25. package/data/icons/136_hmip-miob.webp +0 -0
  26. package/data/icons/137_hmip-fal-c6.webp +0 -0
  27. package/data/icons/138_hmip-fal-c10.webp +0 -0
  28. package/data/icons/140_alpha-ip-rgb.webp +0 -0
  29. package/data/icons/141_alpha-ip-rgba.webp +0 -0
  30. package/data/icons/144_hmip-wgc.webp +0 -0
  31. package/data/icons/145_hmip-froll_hmip-fbl.webp +0 -0
  32. package/data/icons/146_hmip-sth.webp +0 -0
  33. package/data/icons/147_hmip-sthd.webp +0 -0
  34. package/data/icons/148_hmip-stho.webp +0 -0
  35. package/data/icons/149_hmip-sam.webp +0 -0
  36. package/data/icons/151_hmip-pcbs-bat.webp +0 -0
  37. package/data/icons/152_hmip-swdo-i.webp +0 -0
  38. package/data/icons/153_hmip-spi.webp +0 -0
  39. package/data/icons/154_hmip-spdr.webp +0 -0
  40. package/data/icons/155_hmip-whs2.webp +0 -0
  41. package/data/icons/156_hmip-mod-oc8.webp +0 -0
  42. package/data/icons/158_hmip-etrv-uk.webp +0 -0
  43. package/data/icons/159_hmip-mod-rc8.webp +0 -0
  44. package/data/icons/160_hmipw-drs4.webp +0 -0
  45. package/data/icons/161_hmipw-drs8.webp +0 -0
  46. package/data/icons/162_hmipw-drap.webp +0 -0
  47. package/data/icons/163_hmipw-drbl4.webp +0 -0
  48. package/data/icons/164_hmipw-dri16.webp +0 -0
  49. package/data/icons/165_hmipw-fio6.webp +0 -0
  50. package/data/icons/166_hmipw-drd3.webp +0 -0
  51. package/data/icons/167_hmipw-dri32.webp +0 -0
  52. package/data/icons/168_hmip-smi55.webp +0 -0
  53. package/data/icons/169_hmip-swo-pr.webp +0 -0
  54. package/data/icons/170_hmip-swo-pl.webp +0 -0
  55. package/data/icons/171_hmip-swo-b.webp +0 -0
  56. package/data/icons/172_hmip-swd.webp +0 -0
  57. package/data/icons/173_hmip-bsl.webp +0 -0
  58. package/data/icons/174_hmip-slo.webp +0 -0
  59. package/data/icons/175_hmip-group-heating.webp +0 -0
  60. package/data/icons/177_hmip-dbb.webp +0 -0
  61. package/data/icons/178_hmip-etrv-b1.webp +0 -0
  62. package/data/icons/179_hmip-swdm-b2.webp +0 -0
  63. package/data/icons/180_hmip-etrv-b.webp +0 -0
  64. package/data/icons/181_hmip-swdm.webp +0 -0
  65. package/data/icons/182_hmip-fci1.webp +0 -0
  66. package/data/icons/183_hmip-mod-tm.webp +0 -0
  67. package/data/icons/184_hmip-pcbs2.webp +0 -0
  68. package/data/icons/185_hmip-FCI6.webp +0 -0
  69. package/data/icons/186_hmip-mp3p.webp +0 -0
  70. package/data/icons/187_hmip-rcb1.webp +0 -0
  71. package/data/icons/188_hmip-etrv-c.webp +0 -0
  72. package/data/icons/190_hmip-sci.webp +0 -0
  73. package/data/icons/191_hmip-mod-ho.webp +0 -0
  74. package/data/icons/192_hmip-asir-o.webp +0 -0
  75. package/data/icons/193_hmip-wt.webp +0 -0
  76. package/data/icons/194_hmip-wrcd.webp +0 -0
  77. package/data/icons/195_hmipw-smi55.webp +0 -0
  78. package/data/icons/196_hmip-ASIR-2.webp +0 -0
  79. package/data/icons/197_hmip-swdo-pl.webp +0 -0
  80. package/data/icons/198_hmip-falmot-c12.webp +0 -0
  81. package/data/icons/199_hmip-mio16-pcb.webp +0 -0
  82. package/data/icons/200_hmip-wth-b.webp +0 -0
  83. package/data/icons/201_hmip-stv.webp +0 -0
  84. package/data/icons/202_hmip-wrcr.webp +0 -0
  85. package/data/icons/203_hmip-fsi16.webp +0 -0
  86. package/data/icons/204_hmip-drdi3.webp +0 -0
  87. package/data/icons/205_hmip-drsi4.webp +0 -0
  88. package/data/icons/206_hmip-drbli4.webp +0 -0
  89. package/data/icons/207_hmip-srdo.webp +0 -0
  90. package/data/icons/208_hmip-dsd-pcb.webp +0 -0
  91. package/data/icons/209_hmip-etrv-b-uk.webp +0 -0
  92. package/data/icons/210_hmip-ste2-pcb.webp +0 -0
  93. package/data/icons/211_hmip-drg-dali.webp +0 -0
  94. package/data/icons/211_hmip-drsi1.webp +0 -0
  95. package/data/icons/212_hmip-sfd.webp +0 -0
  96. package/data/icons/212_hmipw-scthd.webp +0 -0
  97. package/data/icons/213_hmip-smo230.webp +0 -0
  98. package/data/icons/213_hmip-wua.webp +0 -0
  99. package/data/icons/214_hmip-dld.webp +0 -0
  100. package/data/icons/215_hmip-psm-pe-2.webp +0 -0
  101. package/data/icons/215_hmip-scth230.webp +0 -0
  102. package/data/icons/216_hmip-etrv-e.webp +0 -0
  103. package/data/icons/216_hmip-psm-ch-2.webp +0 -0
  104. package/data/icons/217_hmip-usbsm.webp +0 -0
  105. package/data/icons/218_hmip-dls.webp +0 -0
  106. package/data/icons/219_hmip-fwi.webp +0 -0
  107. package/data/icons/220_hmip-wsc.webp +0 -0
  108. package/data/icons/221_hmip-sti.webp +0 -0
  109. package/data/icons/221_hmip-wkp.webp +0 -0
  110. package/data/icons/222_hmipw-wgd.webp +0 -0
  111. package/data/icons/223_hmip-mod-wd-vk.webp +0 -0
  112. package/data/icons/224_hmip-etrv-cl.webp +0 -0
  113. package/data/icons/225_hmip-rgbw.webp +0 -0
  114. package/data/icons/226_hmip-esi.webp +0 -0
  115. package/data/icons/227_hmip-lsc.webp +0 -0
  116. package/data/icons/228_elv-sh-sw1-bat.webp +0 -0
  117. package/data/icons/229_elv-sh-bm-s.webp +0 -0
  118. package/data/icons/230_hmip-etrv-f.webp +0 -0
  119. package/data/icons/231_elv-sh-cth.webp +0 -0
  120. package/data/icons/232_elv-sh-taco.webp +0 -0
  121. package/data/icons/233_hmip-flc.webp +0 -0
  122. package/data/icons/234_hmip-etrv-3.webp +0 -0
  123. package/data/icons/235_hmip-psmco.webp +0 -0
  124. package/data/icons/236_elv-sh-sb8.webp +0 -0
  125. package/data/icons/237_elv-sh-ctv.webp +0 -0
  126. package/data/icons/238_elv-sh-cap.webp +0 -0
  127. package/data/icons/239_hmip-wgs-f.webp +0 -0
  128. package/data/icons/240_hmip-wgtc-f.webp +0 -0
  129. package/data/icons/241_hmip-wgt-f.webp +0 -0
  130. package/data/icons/242_elv-sh-smsi.webp +0 -0
  131. package/data/icons/243_elv-sh-crc.webp +0 -0
  132. package/data/icons/244_elv-sh-krco.webp +0 -0
  133. package/data/icons/245_hmip-falmot-c8.webp +0 -0
  134. package/data/icons/246_elv-sh-wsm.webp +0 -0
  135. package/data/icons/247_hmip-hap-2.webp +0 -0
  136. package/data/icons/248_hmip-dlp.webp +0 -0
  137. package/data/icons/249_elv-sh-psmci.webp +0 -0
  138. package/data/icons/250_elv-sh-sps25.webp +0 -0
  139. package/data/icons/252_elv-sh-pti2.webp +0 -0
  140. package/data/icons/253_hmip-udi-smi55.webp +0 -0
  141. package/data/icons/254_hmip-udi-pb2.webp +0 -0
  142. package/data/icons/256_ELV-SH-SMS2.webp +0 -0
  143. package/data/icons/257_ELV-SH-FSI.webp +0 -0
  144. package/data/icons/258_hmip-m-td15.webp +0 -0
  145. package/data/icons/259_elv-sh-dusi.webp +0 -0
  146. package/data/icons/260_hmip-wss.webp +0 -0
  147. package/data/icons/54a_lc-ddc1-pcb.webp +0 -0
  148. package/data/icons/72_hm-rc-brc-h.webp +0 -0
  149. package/data/icons/73_hm-atent.webp +0 -0
  150. package/data/icons/79_hm-lc-dim1pwm-cv.webp +0 -0
  151. package/data/icons/84_hm-rc-4-3.webp +0 -0
  152. package/data/icons/85_hm-rc-sec4-3.webp +0 -0
  153. package/data/icons/86_hm-rc-key4-3.webp +0 -0
  154. package/data/icons/CCU3-1-50.webp +0 -0
  155. package/data/icons/CCU3.webp +0 -0
  156. package/data/icons/hm-coupling-dim.webp +0 -0
  157. package/data/icons/hm-coupling-group.webp +0 -0
  158. package/data/icons/hm-coupling-onoff.webp +0 -0
  159. package/data/icons/hm-coupling-rgb-dim.webp +0 -0
  160. package/data/icons/hm-coupling-rgb.webp +0 -0
  161. package/data/icons/hm-coupling-rgbw-dim.webp +0 -0
  162. package/data/icons/hm-coupling-rgbw.webp +0 -0
  163. package/data/icons/hm-coupling-white-dim.webp +0 -0
  164. package/data/icons/hm-coupling-white.webp +0 -0
  165. package/data/icons/hm-hue_gateway.webp +0 -0
  166. package/data/icons/hm-lightify_gateway.webp +0 -0
  167. package/data/icons/hm_resc-win-pcb-sc.webp +0 -0
  168. package/data/icons/unknown_device.webp +0 -0
  169. package/node_modules/@homematic-manager/backend/dist/images/deviceImages.d.ts +6 -0
  170. package/node_modules/@homematic-manager/backend/dist/images/deviceImages.js +38 -2
  171. package/node_modules/@homematic-manager/backend/package.json +1 -1
  172. package/node_modules/@homematic-manager/core/package.json +1 -1
  173. package/package.json +3 -3
  174. package/ui/assets/index-CjI_OM3F.js +16 -0
  175. package/ui/index.html +1 -1
  176. package/ui/assets/index-D-hDPi8h.js +0 -16
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -47,6 +47,12 @@ export declare const MEMORY_CACHE_LIMIT = 200;
47
47
  export declare const IMAGE_MIME_TYPES: Readonly<Record<string, string>>;
48
48
  /** The content type for a file name, or `undefined` for one we would not serve. */
49
49
  export declare function imageMimeType(file: string): string | undefined;
50
+ /**
51
+ * Whether a body is a picture, by its first bytes (B-57): PNG, JPEG, GIF, WebP or SVG. A box
52
+ * without `/config/img` (openccu-lite) answered the request with its UI's HTML page and 200, and
53
+ * that page was cached and served as the device picture.
54
+ */
55
+ export declare function looksLikeImage(body: Buffer): boolean;
50
56
  /**
51
57
  * A file name from `device-icons.json`, as a name and nothing else.
52
58
  *
@@ -58,6 +58,29 @@ export const IMAGE_MIME_TYPES = {
58
58
  export function imageMimeType(file) {
59
59
  return IMAGE_MIME_TYPES[path.extname(file).toLowerCase()];
60
60
  }
61
+ /**
62
+ * Whether a body is a picture, by its first bytes (B-57): PNG, JPEG, GIF, WebP or SVG. A box
63
+ * without `/config/img` (openccu-lite) answered the request with its UI's HTML page and 200, and
64
+ * that page was cached and served as the device picture.
65
+ */
66
+ export function looksLikeImage(body) {
67
+ if (body.length < 4) {
68
+ return false;
69
+ }
70
+ if (body[0] === 0x89 && body.subarray(1, 4).toString('latin1') === 'PNG') {
71
+ return true;
72
+ }
73
+ if (body[0] === 0xff && body[1] === 0xd8 && body[2] === 0xff) {
74
+ return true;
75
+ }
76
+ const head = body.subarray(0, 12).toString('latin1');
77
+ if (head.startsWith('GIF8') || (head.startsWith('RIFF') && head.slice(8, 12) === 'WEBP')) {
78
+ return true;
79
+ }
80
+ // SVG is text: an <svg> root, possibly after an XML declaration or a comment - never an HTML page
81
+ const text = body.subarray(0, 512).toString('utf8').trimStart().toLowerCase();
82
+ return !text.startsWith('<!doctype html') && !text.startsWith('<html') && text.includes('<svg');
83
+ }
61
84
  /**
62
85
  * A file name from `device-icons.json`, as a name and nothing else.
63
86
  *
@@ -163,7 +186,13 @@ export class DeviceImageService {
163
186
  return undefined;
164
187
  }
165
188
  const cacheFile = path.join(this.#options.cacheDir, cacheFileName(deviceType, iconFile));
166
- const fromDisk = await readIfPresent(cacheFile);
189
+ let fromDisk = await readIfPresent(cacheFile);
190
+ if (fromDisk && !looksLikeImage(fromDisk)) {
191
+ // B-57: an earlier version cached what the box answered, a page included
192
+ this.#log.warn(`cached ${cacheFile} is not a picture - removed`);
193
+ await fs.rm(cacheFile, { force: true }).catch(() => undefined);
194
+ fromDisk = undefined;
195
+ }
167
196
  if (fromDisk) {
168
197
  return this.#remember(deviceType, { mime: mimeOrDefault(cacheFile), body: fromDisk, source: 'disk' });
169
198
  }
@@ -200,7 +229,14 @@ export class DeviceImageService {
200
229
  signal: AbortSignal.timeout(this.#options.timeoutMs ?? DEFAULT_IMAGE_TIMEOUT_MS),
201
230
  });
202
231
  if (response.ok) {
203
- return Buffer.from(await response.arrayBuffer());
232
+ const body = Buffer.from(await response.arrayBuffer());
233
+ const type = (response.headers.get('content-type') ?? '').toLowerCase();
234
+ if ((type === '' || type.startsWith('image/')) && looksLikeImage(body)) {
235
+ return body;
236
+ }
237
+ // B-57: a box without the file answered with a page; the next shape may exist
238
+ this.#log.debug(`${url} answered ${response.status} with ${type || 'no type'}, not a picture`);
239
+ continue;
204
240
  }
205
241
  this.#log.debug(`${url} answered ${response.status}`);
206
242
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homematic-manager/backend",
3
- "version": "3.0.0-beta.19",
3
+ "version": "3.0.0-beta.20",
4
4
  "type": "module",
5
5
  "description": "Homematic Manager backend: XML-RPC/BIN-RPC clients and callback servers, caches, optional ReGa",
6
6
  "license": "AGPL-3.0-or-later",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homematic-manager/core",
3
- "version": "3.0.0-beta.19",
3
+ "version": "3.0.0-beta.20",
4
4
  "type": "module",
5
5
  "description": "Pure domain logic of the Homematic Manager: no I/O, no DOM",
6
6
  "license": "AGPL-3.0-or-later",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homematic-manager",
3
- "version": "3.0.0-beta.19",
3
+ "version": "3.0.0-beta.20",
4
4
  "type": "module",
5
5
  "description": "Configure and administer Homematic and HomematicIP devices - devices and channels, direct links, paramsets, RSSI, service messages, events and an RPC console - from a local HTTP/WebSocket server that also serves the web UI",
6
6
  "keywords": [
@@ -67,8 +67,8 @@
67
67
  "hm-simulator": "^1.0.0"
68
68
  },
69
69
  "dependencies": {
70
- "@homematic-manager/backend": "3.0.0-beta.19",
71
- "@homematic-manager/core": "3.0.0-beta.19",
70
+ "@homematic-manager/backend": "3.0.0-beta.20",
71
+ "@homematic-manager/core": "3.0.0-beta.20",
72
72
  "binrpc": "^4.2.0",
73
73
  "homematic-rega": "^2.0.0",
74
74
  "homematic-xmlrpc": "^2.0.0",