homebridge-tydom 0.30.1 → 0.31.2

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2020 Olivier Louvignes <olivier@mgcrea.io>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  <p align="center">
6
6
  <a href="https://github.com/mgcrea/homebridge-tydom">
7
- <img src="https://raw.githubusercontent.com/mgcrea/homebridge-tydom/master/docs/homebridge-tydom_small.png" height="320" alt="Homebridge Tydom Logo" />
7
+ <img src="https://raw.githubusercontent.com/mgcrea/homebridge-tydom/main/docs/homebridge-tydom_small.png" height="320" alt="Homebridge Tydom Logo" />
8
8
  </a>
9
9
  </p>
10
10
 
@@ -79,9 +79,59 @@ Then configure the platform, either in the Homebridge UI or directly in `config.
79
79
 
80
80
  ### Finding your credentials
81
81
 
82
- Your **username** is the MAC address of your gateway: `001A25` followed by the 6-character home ID shown in the mobile app.
82
+ Your **username** is the MAC address of your gateway: `001A25` followed by the 6-character home ID shown in the mobile app. Separators and case do not matter — `00:1a:25:12:34:56` works too.
83
83
 
84
- Your **password** is the one for your Tydom account. Newer setups have it generated by the mobile app and never show it to you; the only known way to recover it is to inspect the app's traffic with an SSL proxy, following [this guide](https://github.com/mgcrea/homebridge-tydom/issues/72#issuecomment-1315036089) from @aure-olivier.
84
+ Your **password** is the gateway's own, which is not the one you sign in to the Tydom app with. Newer setups have it generated by the app and never show it to you.
85
+
86
+ Rather than extract it, add your account **e-mail** and let the plugin fetch it for you:
87
+
88
+ ```json
89
+ {
90
+ "platform": "Tydom",
91
+ "hostname": "mediation.tydom.com",
92
+ "username": "001A25123456",
93
+ "email": "you@example.com",
94
+ "password": "YourDeltaDoreAccountPassw0rd"
95
+ }
96
+ ```
97
+
98
+ With `email` set, `password` is read as your **Delta Dore account** password: at startup the plugin signs in to Delta Dore, looks up the gateway named in `username`, and uses the gateway password it gets back. Nothing else changes, and your account password is never sent to the gateway. Leave `email` out — the default — and `password` keeps its old meaning of the gateway's own password.
99
+
100
+ The account has to already own that gateway. To check a pair without waiting on Homebridge:
101
+
102
+ ```bash
103
+ pnpm resolve-credentials you@example.com 'YourDeltaDoreAccountPassw0rd' 001A25123456
104
+ ```
105
+
106
+ If you would rather extract the gateway password by hand, you still can, by inspecting the app's traffic with an SSL proxy following [this guide](https://github.com/mgcrea/homebridge-tydom/issues/72#issuecomment-1315036089) from @aure-olivier.
107
+
108
+ ### If your account has several houses
109
+
110
+ `username` is what picks the house. One Delta Dore account can hold several — a home, a holiday flat, a relative's place — and each is one gateway with its own MAC. Point `username` at the MAC of the house you want this Homebridge instance to expose, and that is the one you get. Adding `email` does not change that: the account lookup is scoped to the MAC you named, and hands back that gateway's password specifically.
111
+
112
+ To find the MAC of each house, open the Tydom app's home list and read the 6-character home ID next to each one; the MAC is `001A25` followed by that. An account holding three homes gives you three MACs, and each resolves to its own distinct gateway password:
113
+
114
+ ```text
115
+ Maison -> 001A25 AAAAAA
116
+ Appartement -> 001A25 BBBBBB
117
+ Chalet -> 001A25 CCCCCC
118
+ ```
119
+
120
+ Pick the one you want and put it in `username`. Note that the account only ever *confirms* a gateway you name — there is no public Delta Dore API that lists the houses on an account, and the lookup carries no house name either, so the home ID from the app is how you tell them apart.
121
+
122
+ A correct MAC is not the same as access to that house. The lookup resolves any real gateway by MAC, and only the *credentials* are gated on what your account may reach — so a house you have no access to still comes back, just stripped of its password. The plugin says so rather than pretending the MAC is wrong:
123
+
124
+ ```text
125
+ Delta Dore returned no password for gateway 001A25XXXXXX. The gateway exists, but this
126
+ account has no access to that house — sign in with an account that does, or set "password"
127
+ to the gateway password directly and leave "email" out.
128
+ ```
129
+
130
+ As that says, the fallback is to drop `email` and give that house's gateway password directly.
131
+
132
+ Each house gets its own accessory namespace, derived from that home ID, so switching `username` from one house to another retires the first house's accessories and publishes the second's rather than mixing them up. Expect a batch of `Deleting missing accessory` lines in the log the first time you do it — that is the sweep clearing out the house you moved away from.
133
+
134
+ A platform block is one house at a time; the plugin is declared `singular`, so the Homebridge UI allows a single Tydom block. To expose two houses at once you would need a second Homebridge instance, or a hand-written second platform block run as a child bridge.
85
135
 
86
136
  Both secrets can be supplied out of band instead, base64-encoded, which is usually what you want in a container:
87
137
 
@@ -97,8 +147,9 @@ They take precedence over the corresponding config fields.
97
147
  | Field | Type | Default | Description |
98
148
  | --- | --- | --- | --- |
99
149
  | `hostname` | `string` | — | `mediation.tydom.com` for the relay, or your gateway's LAN address (see [Connecting locally](#connecting-locally)). Required. |
100
- | `username` | `string` | — | Gateway MAC address, e.g. `001A25123456`. Required. |
101
- | `password` | `string` | — | Tydom account password. Required, unless supplied via the environment. |
150
+ | `username` | `string` | — | Gateway MAC address, e.g. `001A25123456`. This is what selects the house — see [If your account has several houses](#if-your-account-has-several-houses). Required. |
151
+ | `email` | `string` | — | Delta Dore account e-mail. Set it to have the gateway password fetched for you, which also changes what `password` below means. See [Finding your credentials](#finding-your-credentials). |
152
+ | `password` | `string` | — | Your Delta Dore account password if `email` is set, otherwise the gateway's own password. Required, unless supplied via the environment. |
102
153
  | `pin` | `string` | — | TYXAL+ alarm PIN. Without it the alarm reports its state but cannot be armed or disarmed. |
103
154
  | `locale` | `"fr" \| "en"` | `"fr"` | Language of the labels Delta Dore supplies for zones, detectors and thermostat modes. |
104
155
  | `refreshInterval` | `number` | `14400` | Seconds between full state refreshes. The gateway pushes changes as they happen, so this is only a safety net; clamped to a minimum of 60. |
@@ -121,7 +172,8 @@ Environment variables:
121
172
 
122
173
  | Variable | Description |
123
174
  | --- | --- |
124
- | `HOMEBRIDGE_TYDOM_PASSWORD` | Tydom password, base64-encoded. Overrides `password`. |
175
+ | `HOMEBRIDGE_TYDOM_PASSWORD` | Gateway or account password, base64-encoded. Overrides `password`. |
176
+ | `HOMEBRIDGE_TYDOM_EMAIL` | Delta Dore account e-mail, in plain text. Overrides `email`. |
125
177
  | `HOMEBRIDGE_TYDOM_PIN` | TYXAL+ PIN, base64-encoded. Overrides `pin`. |
126
178
  | `HOMEBRIDGE_TYDOM_LOCALE` | `fr` or `en`. Overrides `locale`. |
127
179
 
@@ -20,12 +20,17 @@
20
20
  "required": true,
21
21
  "description": "Your gateway's MAC address, uppercase and without separators — e.g. `001A25123456`. It is printed underneath the Tydom box."
22
22
  },
23
+ "email": {
24
+ "title": "Delta Dore account e-mail",
25
+ "type": "string",
26
+ "description": "Optional. The e-mail you sign in to the Tydom app with.\n\nFill it in and the password below is read as your **Delta Dore account** password: the plugin signs in at startup and fetches the gateway's own password for you. Leave it empty — the default — and the password below is the **gateway's** password, used as-is.\n\nThe account has to already own the gateway named above; this looks a password up, it cannot discover which gateways you have. Also accepted as a `HOMEBRIDGE_TYDOM_EMAIL` environment variable."
27
+ },
23
28
  "password": {
24
29
  "title": "Password",
25
30
  "type": "string",
26
31
  "required": true,
27
32
  "x-schema-form": { "type": "password" },
28
- "description": "The password of your Tydom account. Can be supplied out of band instead, as a base64-encoded `HOMEBRIDGE_TYDOM_PASSWORD` environment variable, which takes precedence over this field."
33
+ "description": "Your Delta Dore account password if an e-mail is set above, otherwise the gateway's own password. Can be supplied out of band instead, as a base64-encoded `HOMEBRIDGE_TYDOM_PASSWORD` environment variable, which takes precedence over this field."
29
34
  },
30
35
  "pin": {
31
36
  "title": "Alarm PIN",
@@ -121,7 +126,11 @@
121
126
  }
122
127
  },
123
128
  "layout": [
124
- { "type": "fieldset", "title": "Connection", "items": ["hostname", "username", "password"] },
129
+ {
130
+ "type": "fieldset",
131
+ "title": "Connection",
132
+ "items": ["hostname", "username", "email", "password"]
133
+ },
125
134
  {
126
135
  "type": "fieldset",
127
136
  "title": "Alarm",
@@ -0,0 +1,18 @@
1
+ //#region src/config/env.ts
2
+ const PLUGIN_NAME = "homebridge-tydom";
3
+ const PLATFORM_NAME = "Tydom";
4
+ /**
5
+ * The plugin and platform names.
6
+ *
7
+ * Both are frozen: PLATFORM_NAME is the `"platform"` key in every installed
8
+ * user's config.json, and PLUGIN_NAME identifies cached accessories.
9
+ *
10
+ * The HOMEBRIDGE_TYDOM_* environment variables that used to be destructured
11
+ * here are read by parseConfig instead, so they can be tested and so they are
12
+ * resolved after Homebridge has read the config rather than at import time.
13
+ */
14
+ const { DEBUG } = process.env;
15
+ //#endregion
16
+ export { PLUGIN_NAME as n, PLATFORM_NAME as t };
17
+
18
+ //# sourceMappingURL=env-B2-Dw8C2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env-B2-Dw8C2.mjs","names":[],"sources":["../src/config/env.ts"],"sourcesContent":["export const PLUGIN_NAME = \"homebridge-tydom\";\nexport const PLATFORM_NAME = \"Tydom\";\n/**\n * The plugin and platform names.\n *\n * Both are frozen: PLATFORM_NAME is the `\"platform\"` key in every installed\n * user's config.json, and PLUGIN_NAME identifies cached accessories.\n *\n * The HOMEBRIDGE_TYDOM_* environment variables that used to be destructured\n * here are read by parseConfig instead, so they can be tested and so they are\n * resolved after Homebridge has read the config rather than at import time.\n */\nexport const { DEBUG } = process.env;\n"],"mappings":";AAAA,MAAa,cAAc;AAC3B,MAAa,gBAAgB;;;;;;;;;;;AAW7B,MAAa,EAAE,UAAU,QAAQ"}
package/dist/index.d.mts CHANGED
@@ -1,7 +1,6 @@
1
- import "source-map-support/register.js";
2
1
  import { API } from "homebridge";
3
2
  //#region src/index.d.ts
4
- declare const _default: (homebridge: API) => void;
3
+ declare function _default(homebridge: API): void;
5
4
  //#endregion
6
5
  export { _default as default };
7
6
  //# sourceMappingURL=index.d.mts.map