homebridge-dummy 1.0.0-beta.0 → 1.0.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/CHANGELOG.md CHANGED
@@ -1,20 +1,23 @@
1
- <!-- ⚠️ Plugin has a new owner/maintainer and will undergo significant cleanup and modernization in the near term. If you experience issues you can always downgrade to the last stable version v0.9.0
1
+ ## ‼️ WARNING - READ BEFORE CONTINUING ‼️
2
2
 
3
- Please report any issues you encounter here: https://github.com/mpatfield/homebridge-dummy/issues -->
3
+ If upgrading from v0.9.2 or earlier, automations and scenes using Homebridge Dummy accessories will need to be reconfigured.
4
4
 
5
- # ‼️ BREAKING CHANGES ‼️
5
+ ## ⚠️ IMPORTANT ⚠️
6
6
 
7
- ### If upgrading from v0.9.2, Homebridge Dummy accessories will need to be reconfigured!!
7
+ After installing v1.0, you must **RESTART HOMEBRIDGE SERVICE & UI** (not just *RESTART HOMEBRIDGE*) before continuing or you will experience issues with Homebridge Dummy configuration.
8
8
 
9
- ### Please downgrade to v0.9.2 or earlier now if you want to keep your current setup
9
+ Once you have restarted both Homebridge and the UI, you will need to open the Homebridge Dummy plugin settings to run the accessory migration helper.
10
10
 
11
- ### Full details [here](https://github.com/mpatfield/homebridge-dummy?tab=readme-ov-file#v10-migration).
11
+ Full details [here](https://github.com/mpatfield/homebridge-dummy?tab=readme-ov-file#v10-migration).
12
12
 
13
13
  # Change Log
14
14
 
15
15
  All notable changes to homebridge-dummy will be documented in this file.
16
16
 
17
- ## 1.0.0-beta.0 (2025-07-14)
17
+ ## 1.0.0 (2025-07-23)
18
+
19
+ ### Changed
20
+ - Complete code re-write to use [Platform Plugin](https://developers.homebridge.io/#/api/platform-plugins) instead of [Accessory Plugin](https://developers.homebridge.io/#/api/accessory-plugins)
18
21
 
19
22
  ### Added
20
23
  - Drastically improved config UI
@@ -23,9 +26,6 @@ All notable changes to homebridge-dummy will be documented in this file.
23
26
  - Sensor support (CO2, CO, Contact, Leak, Motion, Occupancy, and Smoke)
24
27
  - Execute arbitraty commands when accessory state changes
25
28
 
26
- ### Changed
27
- - Complete code re-write to use [Platform Plugin](https://developers.homebridge.io/#/api/platform-plugins) instead of [Accessory Plugin](https://developers.homebridge.io/#/api/accessory-plugins)
28
-
29
29
  ## 0.9.2 (2025-06-26)
30
30
 
31
31
  ### Fixed
package/README.md CHANGED
@@ -1,8 +1,7 @@
1
- <!--
1
+
2
2
  <p align="center">
3
3
  <img src="https://github.com/mpatfield/homebridge-dummy/blob/latest/img/banner.png?raw=true" width="600">
4
4
  </p>
5
- -->
6
5
 
7
6
  <span align="center">
8
7
 
@@ -25,7 +24,7 @@ Any issues or damage resulting from use of this plugin are not the fault of the
25
24
 
26
25
  ### tl;dr
27
26
 
28
- ‼️ There are significant code changes between v0.9 and v1.0 which means you will need to reconfigure HomeKit automations after upgrading. Homebridge Dummy will try to migrate old accessories in Homebridge so you don't need to recreate everything.
27
+ ‼️ There are significant code changes between v0.9 and v1.0 which means you will need to reconfigure HomeKit automations after upgrading. Homebridge Dummy will try to help migrate old accessories.
29
28
 
30
29
  ### Why?
31
30
 
@@ -33,16 +32,18 @@ The original HomebridgeDummy was written almost 10 years ago and uses the now de
33
32
 
34
33
  While this still works okay for now, migrating the code to use [Platform Plugins](https://developers.homebridge.io/#/api/platform-plugins) will future-proof Homebridge Dummy and allow for more modern and robust design patterns.
35
34
 
36
- v1.0 doesn't include any new features but will make it much easier to improve and extend this plugin going forward.
35
+ The architecture used in v1.0 will make it much easier to improve and extend this plugin going forward and already includes several new features.
37
36
 
38
37
  ### Drawbacks
39
38
 
40
39
  Unfortunately, there is no built-in way to migrate existing accessory plugins to platform plugins. This means that all accessories will be considered "new" by HomeKit, so any existing automations or room setups will be lost.
41
40
 
42
- However, Homebridge Dummy will try to migrate the accessory configurations to the new system to prevent you having to set them all up again in Homebridge.
41
+ However, Homebridge Dummy will try to help migrate the accessory configurations to the new system to prevent you having to set them all up again in Homebridge.
43
42
 
44
43
  ### Migration Flow
45
44
 
45
+ ⚠️ Please make sure to restart both Homebridge Service AND Homebridge UI after upgrading to v1.0 or you will experience issues with Homebridge Dummy configuration.
46
+
46
47
  Once you have installed v1.0, click on the icon to configure the Homebridge Dummy plugin in the Homebridge UI and it will walk you through the necessary questionnaire.
47
48
 
48
49
  Alternatively, you can add the following to "platforms" in your config.json
@@ -57,15 +58,15 @@ Alternatively, you can add the following to "platforms" in your config.json
57
58
 
58
59
  You will need to restart Homebridge after completing the flow for changes to take effect.
59
60
 
60
- ⚠️ If you are using child bridges with v0.9, you will need to restart Homebridge _twice_ for migrated accessories to show up correctly.
61
+ ⚠️ If you are using child bridges with v0.9, you may need to restart Homebridge _twice_ for migrated accessories to show up correctly.
61
62
 
62
63
  You may safely ignore any "No plugin was found…" errors you see in the Homebridge logs. These should go away after a few Homebridge restarts.
63
64
 
64
65
  ### Problems?
65
66
 
66
- This is a highly experimental flow and may not work as intended. If you see "Sorry, something went wrong with the accessory migration" or encounter other issues, please [create an issue](https://github.com/mpatfield/homebridge-dummy/issues/new?template=new-issue.md).
67
+ This is an experimental flow and may not work as intended. If you see "Sorry, something went wrong with the accessory migration" or encounter other issues, please [create an issue](https://github.com/mpatfield/homebridge-dummy/issues/new?template=new-issue.md).
67
68
 
68
- The first thing the flow does is create a backup called `config.json.bak` in your Homebridge directory. If all else fails, you can replace your `config.json` with the backup and downgrade to Homebridge Dummy v0.9 to restore everything back to normal.
69
+ The first thing the flow does is create a backup called `config.json.bak` in your Homebridge directory. If all else fails, you can replace your `config.json` with the backup and downgrade to Homebridge Dummy v0.9 to restore your previous accessories.
69
70
 
70
71
  ## About
71
72
 
@@ -253,4 +254,6 @@ All fields are optional unless noted with an asterisk (*)
253
254
 
254
255
  Special thanks to [@nfarina](https://github.com/nfarina) for creating the original version of this plugin and maintaining it for almost 10 (!!!) years
255
256
 
257
+ [Keryan Belahcene](https://www.instagram.com/keryan.me) for creating the [Flume](https://github.com/homebridge-plugins/homebridge-flume) banner image which was adapted for use with this plugin
258
+
256
259
  And to the amazing creators/contributors of [Homebridge](https://homebridge.io) who made this plugin possible!
@@ -21,7 +21,7 @@ export class OnOffAccessory extends DummyAccessory {
21
21
  this.accessoryService.updateCharacteristic(this.Characteristic.On, this.on);
22
22
  }
23
23
  get defaultOn() {
24
- return this.config.defaultOn ? 1 : 0;
24
+ return this.config.defaultOn ? true : false;
25
25
  }
26
26
  async getOn() {
27
27
  return this.on;
@@ -1 +1 @@
1
- {"version":3,"file":"onoff.js","sourceRoot":"","sources":["../../../src/accessory/onoff/onoff.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAK7C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEhE,MAAM,OAAgB,cAAoD,SAAQ,cAAiB;IAEzF,EAAE,CAAsB;IAExB,MAAM,CAAmB;IAEjC,YACE,OAAoB,EACpB,cAAkC,EAClC,SAA4B,EAC5B,MAAS,EACT,GAAQ,EACR,WAAmB,EACnB,SAAkB;QAElB,KAAK,CAAC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;QAE/E,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;QAEzB,IAAI,CAAC,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QAEzI,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,cAAc,CAAC,EAAE,CAAC;aACvD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,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C;QAClD,CAAC;QAED,IAAI,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAC9E,CAAC;IAEO,KAAK,CAAC,IAAI;QAChB,MAAM,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC;IAES,UAAU,CAAC,KAA0B;QAC7C,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAClH,CAAC;CACF"}
@@ -5,13 +5,15 @@
5
5
  }
6
6
  </style>
7
7
 
8
- <!-- <p class="text-center">
9
- <img
10
- src="https://github.com/mpatfield/homebridge-dummy/blob/latest/img/banner.png?raw=true"
11
- alt="Homebridge Dummy"
12
- style="width: 60%;"
13
- />
14
- </p> -->
8
+ <div id="header">
9
+ <p class="text-center">
10
+ <img
11
+ src="https://github.com/mpatfield/homebridge-dummy/blob/latest/img/banner.png?raw=true"
12
+ alt="Homebridge Dummy"
13
+ style="width: 60%;"
14
+ />
15
+ </p>
16
+ </div>
15
17
 
16
18
  <div id="support" class="text-center" style="display: none;">
17
19
  <p i18n="support" i18n_replace="github"></p>
@@ -25,14 +27,14 @@
25
27
  </div>
26
28
 
27
29
  <div id="migration" class="text-center" style="display: none;">
28
- <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/1/17/Warning.svg/156px-Warning.svg.png"/>
30
+ <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Achtung.svg/330px-Achtung.svg.png" width="100px"/>
29
31
  </br></br>
30
- <h1><p class="text-danger" i18n="migrationDetails1" i18n_replace="dummy"></p></h1>
32
+ <h5><p class="text-danger" i18n="migrationDetails1" i18n_replace="dummy"></p></h5>
31
33
  <p class="lead" i18n="migrationDetails2"></p>
32
- <br/>
33
34
  <hr/>
34
35
  <br/>
35
36
  <p class="lead" i18n="migrationDetails3" i18n_replace="dummy"></p>
37
+ <br/>
36
38
  <p class="lead" i18n="migrationDetails4"></p>
37
39
  <br/>
38
40
  <button type="button" class="btn btn-primary" id="skipMigration" i18n="no"></button>&nbsp;&nbsp;
@@ -41,4 +43,4 @@
41
43
  <em><p i18n="migrationDetails5" i18n_replace="migration"></p></em></br>
42
44
  </div>
43
45
 
44
- <script src="ui.js?v=1.0.0-beta.0"></script>
46
+ <script src="ui.js?v=1.0.0"></script>
@@ -1 +1 @@
1
- "use strict";(()=>{var r="Homebridge Dummy";var g={github:'<a target="_blank" href="https://github.com/mpatfield/homebridge-dummy/">GitHub</a>',migration:'<a target="_blank" href="https://github.com/mpatfield/homebridge-dummy?tab=readme-ov-file#v10-migration">GitHub</a>',dummy:r},l=e=>{document.querySelectorAll("[i18n]").forEach(t=>{let o=t.getAttribute("i18n"),i=e.config[o],n=t.getAttribute("i18n_replace");n&&(i=i.replace("%s",g[n])),t.innerHTML=i})},u=e=>{let t=["span","label","legend","option","p"];Array.from(window.parent.document.querySelectorAll(t.join(","))).sort((i,n)=>t.indexOf(i.tagName.toLowerCase())-t.indexOf(n.tagName.toLowerCase())).forEach(i=>{let n=i.innerHTML;n=n.replaceAll(/\$\{config\.(title|description|enumNames)\.([^}]+)\}/g,(m,a,c)=>e.config[a]&&typeof e.config[a]=="object"&&c in e.config[a]?e.config[a][c]:m),i.innerHTML!==n&&(i.innerHTML=n)})},d=e=>{let t=Array.from(window.parent.document.querySelectorAll("fieldset legend"));for(let o of t){let n=o.closest("fieldset")?.querySelector('input[type="text"][name="name"]');n&&o.textContent!==(n.value||e.config.title.accessory)&&(o.textContent=n.value!==""?n.value:e.config.title.accessory),n&&!n.dataset.accessoryNameListener&&(n.addEventListener("input",()=>d(e)),n.dataset.accessoryNameListener="true")}};function x(){if(typeof crypto<"u"){if(crypto.randomUUID)return crypto.randomUUID();if(crypto.getRandomValues)return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=crypto.getRandomValues(new Uint8Array(1))[0]&15;return(e==="x"?t:t&3|8).toString(16)})}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var f=e=>{let t=!1;e.accessories?.forEach(o=>{if(o.id===void 0){let i=x();o.id=i,t=!0}}),t&&homebridge.updatePluginConfig([e])},s=e=>{document.getElementById("intro").style.display="none",document.getElementById("migration").style.display="none",document.getElementById("support").style.display="block",new MutationObserver(()=>{u(e),d(e)}).observe(window.parent.document.body,{childList:!0,subtree:!0}),homebridge.showSchemaForm(),homebridge.addEventListener("configChanged",o=>{let i=o.data;i.length&&f(i[0])}),homebridge.enableSaveButton(),homebridge.hideSpinner()},y=e=>{document.getElementById("intro").style.display="none",document.getElementById("migration").style.display="block",document.getElementById("skipMigration").addEventListener("click",async()=>{await homebridge.updatePluginConfig([{name:r}]),await homebridge.savePluginConfig(),s(e)}),document.getElementById("doMigration").addEventListener("click",async()=>{await homebridge.updatePluginConfig([{name:r,migrationNeeded:!0}]),await homebridge.savePluginConfig(),homebridge.closeSettings(),homebridge.toast.info(e.config.migrationRestartDescription.replace("%s",r),e.config.migrationRestartTitle)})},p=e=>{homebridge.disableSaveButton(),document.getElementById("showSettings").addEventListener("click",async()=>{await homebridge.updatePluginConfig([{name:r}]),s(e)}),document.getElementById("showMigration").addEventListener("click",()=>{y(e)}),document.getElementById("intro").style.display="block",homebridge.hideSpinner()};(async()=>{homebridge.showSpinner();let e=await homebridge.i18nCurrentLang(),t=await homebridge.request("i18n",e);l(t),(await homebridge.getPluginConfig()).length?s(t):p(t)})();})();
1
+ "use strict";(()=>{var r="Homebridge Dummy";var l={github:'<a target="_blank" href="https://github.com/mpatfield/homebridge-dummy/">GitHub</a>',migration:'<a target="_blank" href="https://github.com/mpatfield/homebridge-dummy?tab=readme-ov-file#v10-migration">GitHub</a>',dummy:r},g=e=>{document.querySelectorAll("[i18n]").forEach(t=>{let o=t.getAttribute("i18n"),i=e.config[o],n=t.getAttribute("i18n_replace");n&&(i=i.replace("%s",l[n])),t.innerHTML=i})},u=e=>{let t=["span","label","legend","option","p"];Array.from(window.parent.document.querySelectorAll(t.join(","))).sort((i,n)=>t.indexOf(i.tagName.toLowerCase())-t.indexOf(n.tagName.toLowerCase())).forEach(i=>{let n=i.innerHTML;n=n.replaceAll(/\$\{config\.(title|description|enumNames)\.([^}]+)\}/g,(m,a,d)=>e.config[a]&&typeof e.config[a]=="object"&&d in e.config[a]?e.config[a][d]:m),i.innerHTML!==n&&(i.innerHTML=n)})},c=e=>{let t=Array.from(window.parent.document.querySelectorAll("fieldset legend"));for(let o of t){let n=o.closest("fieldset")?.querySelector('input[type="text"][name="name"]');n&&o.textContent!==(n.value||e.config.title.accessory)&&(o.textContent=n.value!==""?n.value:e.config.title.accessory),n&&!n.dataset.accessoryNameListener&&(n.addEventListener("input",()=>c(e)),n.dataset.accessoryNameListener="true")}};function x(){if(typeof crypto<"u"){if(crypto.randomUUID)return crypto.randomUUID();if(crypto.getRandomValues)return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=crypto.getRandomValues(new Uint8Array(1))[0]&15;return(e==="x"?t:t&3|8).toString(16)})}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var f=e=>{let t=!1;e.accessories?.forEach(o=>{if(o.id===void 0){let i=x();o.id=i,t=!0}}),t&&homebridge.updatePluginConfig([e])},s=e=>{document.getElementById("intro").style.display="none",document.getElementById("migration").style.display="none",document.getElementById("support").style.display="block",new MutationObserver(()=>{u(e),c(e)}).observe(window.parent.document.body,{childList:!0,subtree:!0}),homebridge.showSchemaForm(),homebridge.addEventListener("configChanged",o=>{let i=o.data;i.length&&f(i[0])}),homebridge.enableSaveButton(),homebridge.hideSpinner()},y=e=>{document.getElementById("header").style.display="none",document.getElementById("intro").style.display="none",document.getElementById("migration").style.display="block",document.getElementById("skipMigration").addEventListener("click",async()=>{await homebridge.updatePluginConfig([{name:r}]),await homebridge.savePluginConfig(),s(e)}),document.getElementById("doMigration").addEventListener("click",async()=>{await homebridge.updatePluginConfig([{name:r,migrationNeeded:!0}]),await homebridge.savePluginConfig(),homebridge.closeSettings(),homebridge.toast.info(e.config.migrationRestartDescription.replace("%s",r),e.config.migrationRestartTitle)})},p=e=>{homebridge.disableSaveButton(),document.getElementById("showSettings").addEventListener("click",async()=>{await homebridge.updatePluginConfig([{name:r}]),s(e)}),document.getElementById("showMigration").addEventListener("click",()=>{y(e)}),document.getElementById("intro").style.display="block",homebridge.hideSpinner()};(async()=>{homebridge.showSpinner();let e=await homebridge.i18nCurrentLang(),t=await homebridge.request("i18n",e);g(t),(await homebridge.getPluginConfig()).length?s(t):p(t)})();})();
package/dist/i18n/en.js CHANGED
@@ -31,13 +31,13 @@ const en = {
31
31
  },
32
32
  config: {
33
33
  migrate: 'Are you upgrading from an earlier version?',
34
- migrationDetails1: 'HomeKit automations using %s accessories will need to be reconfigured!',
34
+ migrationDetails1: 'HomeKit scenes and automations using %s accessories will need to be reconfigured!', // plugin name
35
35
  migrationDetails2: 'Please downgrade to v0.9.2 or earlier if you want to keep your current setup.',
36
- migrationDetails3: '%s can try to recreate your accessories, but you will still need reconfigure HomeKit automations.',
36
+ migrationDetails3: '%s can try to recreate your accessories, but you will still need reconfigure HomeKit scenes and automations.', // plugin name
37
37
  migrationDetails4: 'Would you like to recreate your accessories now?',
38
38
  migrationDetails5: 'For more details, please visit %s',
39
- migrationRestartTitle: 'Restart Homebridge',
40
- migrationRestartDescription: 'Please restart Homebridge to begin %s migration',
39
+ migrationRestartTitle: 'RESTART HB SERVICE & UI',
40
+ migrationRestartDescription: 'Please restart BOTH HB Service and UI now to begin %s migration', // plugin name
41
41
  support: 'For documentation and support please visit %s',
42
42
  thankYou: 'Thank you for installing %s',
43
43
  yes: 'Yes',
@@ -1 +1 @@
1
- {"version":3,"file":"en.js","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA,MAAM,EAAE,GAAG;IAET,SAAS,EAAE;QAET,eAAe,EAAE,2CAA2C;QAE5D,OAAO,EAAE;YACP,QAAQ,EAAE,qBAAqB;YAC/B,KAAK,EAAE,8BAA8B;SACtC;QAED,SAAS,EAAE;YACT,UAAU,EAAE,qBAAqB;YACjC,OAAO,EAAE,cAAc;SACxB;QAED,IAAI,EAAE;YACJ,OAAO,EAAE,cAAc;YACvB,SAAS,EAAE,gBAAgB;SAC5B;QAED,KAAK,EAAE;YACL,OAAO,EAAE,UAAU;YACnB,QAAQ,EAAE,WAAW;SACtB;QAED,QAAQ,EAAE;YACR,MAAM,EAAE,cAAc;YACtB,IAAI,EAAE,YAAY;SACnB;QAED,KAAK,EAAE;YACL,MAAM,EAAE,4BAA4B;YACpC,KAAK,EAAE,wBAAwB;YAC/B,UAAU,EAAE,0BAA0B;YACtC,UAAU,EAAE,0BAA0B;YACtC,QAAQ,EAAE,wBAAwB;SACnC;KACF;IAED,MAAM,EAAE;QACN,OAAO,EAAE,4CAA4C;QACrD,iBAAiB,EAAE,wEAAwE;QAC3F,iBAAiB,EAAE,+EAA+E;QAClG,iBAAiB,EAAE,mGAAmG;QACtH,iBAAiB,EAAE,kDAAkD;QACrE,iBAAiB,EAAE,mCAAmC;QACtD,qBAAqB,EAAE,oBAAoB;QAC3C,2BAA2B,EAAE,iDAAiD;QAC9E,OAAO,EAAE,+CAA+C;QACxD,QAAQ,EAAE,6BAA6B;QACvC,GAAG,EAAE,KAAK;QACV,EAAE,EAAE,IAAI;QAER,WAAW,EAAE;YACX,QAAQ,EAAE,+DAA+D;YACzE,MAAM,EAAE,4DAA4D;YACpE,KAAK,EAA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AE,gCAAgC;SAC3C;QAED,KAAK,EAAE;YACL,MAAM,EAAE,mBAAmB;YAC3B,QAAQ,EAAE,4BAA4B;SACvC;KACF;IAED,OAAO,EAAE;QACP,eAAe,EAAE,iFAAiF;QAClG,iBAAiB,EAAE,uCAAuC;QAC1D,sBAAsB,EAAE,2CAA2C;QACnE,eAAe,EAAE,kHAAkH;QACnI,eAAe,EAAE,0DAA0D;QAC3E,eAAe,EAAE,+FAA+F;QAChH,YAAY,EAAE,uBAAuB;QACrC,eAAe,EAAE,qBAAqB;QACtC,kBAAkB,EAAE,sBAAsB;QAC1C,aAAa,EAAE,kBAAkB;QACjC,eAAe,EAAE,+BAA+B;QAChD,OAAO,EAAE;YACP,4GAA4G;YAC5G,8EAA8E;YAC9E,4EAA4E;YAC5E,qHAAqH;SACtH;KACF;CACF,CAAC;AAEF,eAAe,EAAE,CAAC"}
@@ -20,7 +20,7 @@ function migrateAccessory(legacyConfig) {
20
20
  }
21
21
  if (!legacyConfig.stateful && legacyConfig.time) {
22
22
  dummyConfig.timer = {
23
- delay: Math.min(1, legacyConfig.time / 1000),
23
+ delay: Math.max(1, legacyConfig.time / 1000),
24
24
  units: TimeUnits.SECONDS,
25
25
  random: legacyConfig.random,
26
26
  };
package/img/banner.png ADDED
Binary file
package/img/banner.xcf ADDED
Binary file
package/img/icon.png ADDED
Binary file
package/img/icon.xcf ADDED
Binary file
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "displayName": "Homebridge Dummy",
5
5
  "description": "Dummy devices for Homebridge",
6
6
  "type": "module",
7
- "version": "1.0.0-beta.0",
7
+ "version": "1.0.0",
8
8
  "homepage": "https://github.com/mpatfield/homebridge-dummy#readme",
9
9
  "repository": {
10
10
  "type": "git",