matterbridge-lg-thinq-plugin 0.1.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/.claude/CLAUDE.md +43 -0
- package/.claude/agents/compiler.md +91 -0
- package/.claude/agents/direct-executor.md +98 -0
- package/.claude/agents/documenter.md +78 -0
- package/.claude/agents/finalizer.md +233 -0
- package/.claude/agents/implementer.md +112 -0
- package/.claude/agents/investigator.md +100 -0
- package/.claude/agents/release-manager.md +203 -0
- package/.claude/agents/reviewer.md +131 -0
- package/.claude/agents/technical-architect.md +403 -0
- package/.claude/agents/test-writer.md +159 -0
- package/.claude/agents/wiki-manager.md +147 -0
- package/.claude/instructions/agent-prompts.md +90 -0
- package/.claude/instructions/shared-rules.md +11 -0
- package/.claude/instructions/team-orchestrator-policy.md +165 -0
- package/.claude/memory.md +186 -0
- package/.claude/output-styles/engineer-manager.md +38 -0
- package/.claude/settings.json +40 -0
- package/.claude/settings.local.json +30 -0
- package/.claude/skills/load-policy/SKILL.md +13 -0
- package/.claude/skills/ref-idea/SKILL.md +44 -0
- package/.claude/skills/status-of/SKILL.md +38 -0
- package/.claude/skills/workspace-console/SKILL.md +49 -0
- package/.claude/statusline-command.sh +130 -0
- package/.claude/statusline.md +53 -0
- package/.claude/templates/approval-packet.template.html +171 -0
- package/.claude/templates/reference-workspaces.md +16 -0
- package/.claude/tools/cli-runner-server.cjs +220 -0
- package/.claude/tools/discord-send-server.cjs +188 -0
- package/.claude/tools/github-release-server.cjs +181 -0
- package/.claude/tools/glob-grep-server.cjs +267 -0
- package/.claude/tools/read-log-server.cjs +175 -0
- package/.github/codeql/codeql-config.yml +14 -0
- package/.github/workflows/build.yml +54 -0
- package/.github/workflows/codeql.yml +59 -0
- package/.github/workflows/coverage.yml +70 -0
- package/.github/workflows/publish.yml +103 -0
- package/.mcp.json +34 -0
- package/CHANGELOG.md +195 -0
- package/LICENSE +21 -0
- package/dist/cli/commands/devices.js +52 -0
- package/dist/cli/commands/energy.js +122 -0
- package/dist/cli/commands/login.js +54 -0
- package/dist/cli/help.js +50 -0
- package/dist/cli/main.js +56 -0
- package/dist/cli/session.js +13 -0
- package/dist/cli/types.js +1 -0
- package/dist/cli/utils.js +29 -0
- package/dist/cli.js +2 -0
- package/dist/constants/index.js +1 -0
- package/dist/core/domain/entities/ThinqDevice.js +43 -0
- package/dist/core/domain/value-objects/AirConditionerCapabilities.js +22 -0
- package/dist/core/domain/value-objects/ThinqFilterState.js +35 -0
- package/dist/core/domain/value-objects/ThinqSnapshot.js +125 -0
- package/dist/errors/AuthenticationError.js +26 -0
- package/dist/errors/BaseError.js +23 -0
- package/dist/errors/index.js +2 -0
- package/dist/model/LgThinkqPluginPlatformConfig.js +23 -0
- package/dist/model/LgThinqPluginPlatformConfig.js +23 -0
- package/dist/module.js +212 -0
- package/dist/platform/deviceRegistry.js +26 -0
- package/dist/platform/platformConfigManager.js +89 -0
- package/dist/platform/platformState.js +9 -0
- package/dist/platform/thinq/thinqAirConditionerCommandHandlers.js +190 -0
- package/dist/platform/thinq/thinqAirConditionerEndpointFactory.js +53 -0
- package/dist/platform/thinq/thinqAirConditionerFilterResetCommandHandler.js +54 -0
- package/dist/platform/thinq/thinqAirConditionerFilterStateSync.js +19 -0
- package/dist/platform/thinq/thinqAirConditionerStateSync.js +205 -0
- package/dist/platform/thinq/thinqDeviceConfigReconciler.js +26 -0
- package/dist/platform/thinq/thinqDeviceConfigurator.js +124 -0
- package/dist/platform/thinq/thinqDeviceDiscovery.js +33 -0
- package/dist/platform/thinq/thinqWasherCommandHandlers.js +54 -0
- package/dist/platform/thinq/thinqWasherEndpointFactory.js +6 -0
- package/dist/platform/thinq/thinqWasherStateSync.js +31 -0
- package/dist/platform/thinq/thinqWasherStopCommandResolver.js +38 -0
- package/dist/services/authentication/AccountAuthStrategy.js +135 -0
- package/dist/services/authentication/AuthContext.js +1 -0
- package/dist/services/authentication/AuthenticationCoordinator.js +29 -0
- package/dist/services/authentication/IAuthStrategy.js +1 -0
- package/dist/services/authentication/TokenAuthStrategy.js +27 -0
- package/dist/services/authentication/UserDataRepository.js +32 -0
- package/dist/services/thinq/gateway.js +61 -0
- package/dist/services/thinq/mqtt/mqttCertificate.js +63 -0
- package/dist/services/thinq/mqtt/mqttConnectionEvents.js +37 -0
- package/dist/services/thinq/mqtt/mqttKeyRepository.js +33 -0
- package/dist/services/thinq/mqtt/mqttRetry.js +25 -0
- package/dist/services/thinq/mqtt/thinqMqttListener.js +97 -0
- package/dist/services/thinq/serviceContainer.js +73 -0
- package/dist/services/thinq/session.js +48 -0
- package/dist/services/thinq/thinqApiClient.js +258 -0
- package/dist/services/thinq/thinqDeviceService.js +75 -0
- package/dist/services/thinq/thinqFilterMonitoringService.js +40 -0
- package/dist/settings.js +9 -0
- package/dist/tests/helpers/testUtils.js +87 -0
- package/dist/utils/mask.js +39 -0
- package/docs/README_CLI.md +166 -0
- package/eslint.config.js +194 -0
- package/matterbridge-lg-thinq-plugin.config.json +27 -0
- package/matterbridge-lg-thinq-plugin.schema.json +520 -0
- package/package.json +107 -0
- package/prettier.config.js +49 -0
- package/scripts/parse-junit-failures.mjs +45 -0
- package/scripts/parse-tsc-failures.mjs +48 -0
- package/scripts/run-build-local-summary.mjs +29 -0
- package/scripts/run-format-summary.mjs +36 -0
- package/scripts/run-lint-fix-summary.mjs +38 -0
- package/scripts/run-precommit-summary.mjs +94 -0
- package/src/cli/commands/devices.ts +67 -0
- package/src/cli/commands/energy.ts +160 -0
- package/src/cli/commands/login.ts +74 -0
- package/src/cli/help.ts +53 -0
- package/src/cli/main.ts +66 -0
- package/src/cli/session.ts +15 -0
- package/src/cli/types.ts +10 -0
- package/src/cli/utils.ts +30 -0
- package/src/cli.ts +3 -0
- package/src/constants/index.ts +8 -0
- package/src/core/domain/entities/ThinqDevice.test.ts +224 -0
- package/src/core/domain/entities/ThinqDevice.ts +74 -0
- package/src/core/domain/value-objects/AirConditionerCapabilities.ts +50 -0
- package/src/core/domain/value-objects/ThinqFilterState.ts +50 -0
- package/src/core/domain/value-objects/ThinqSnapshot.ts +162 -0
- package/src/errors/AuthenticationError.ts +37 -0
- package/src/errors/BaseError.ts +38 -0
- package/src/errors/index.ts +24 -0
- package/src/model/LgThinqPluginPlatformConfig.ts +94 -0
- package/src/module.ts +298 -0
- package/src/platform/deviceRegistry.ts +58 -0
- package/src/platform/platformConfigManager.ts +133 -0
- package/src/platform/platformState.ts +16 -0
- package/src/platform/thinq/thinqAirConditionerCommandHandlers.ts +291 -0
- package/src/platform/thinq/thinqAirConditionerEndpointFactory.ts +145 -0
- package/src/platform/thinq/thinqAirConditionerFilterResetCommandHandler.ts +96 -0
- package/src/platform/thinq/thinqAirConditionerFilterStateSync.ts +42 -0
- package/src/platform/thinq/thinqAirConditionerStateSync.ts +343 -0
- package/src/platform/thinq/thinqDeviceConfigReconciler.ts +42 -0
- package/src/platform/thinq/thinqDeviceConfigurator.test.ts +90 -0
- package/src/platform/thinq/thinqDeviceConfigurator.ts +191 -0
- package/src/platform/thinq/thinqDeviceDiscovery.test.ts +173 -0
- package/src/platform/thinq/thinqDeviceDiscovery.ts +51 -0
- package/src/platform/thinq/thinqWasherCommandHandlers.ts +120 -0
- package/src/platform/thinq/thinqWasherEndpointFactory.ts +37 -0
- package/src/platform/thinq/thinqWasherStateSync.ts +60 -0
- package/src/platform/thinq/thinqWasherStopCommandResolver.ts +62 -0
- package/src/services/authentication/AccountAuthStrategy.test.ts +358 -0
- package/src/services/authentication/AccountAuthStrategy.ts +209 -0
- package/src/services/authentication/AuthContext.ts +19 -0
- package/src/services/authentication/AuthenticationCoordinator.test.ts +217 -0
- package/src/services/authentication/AuthenticationCoordinator.ts +59 -0
- package/src/services/authentication/IAuthStrategy.ts +10 -0
- package/src/services/authentication/TokenAuthStrategy.test.ts +167 -0
- package/src/services/authentication/TokenAuthStrategy.ts +40 -0
- package/src/services/authentication/UserDataRepository.test.ts +149 -0
- package/src/services/authentication/UserDataRepository.ts +46 -0
- package/src/services/thinq/gateway.ts +86 -0
- package/src/services/thinq/mqtt/mqttCertificate.test.ts +344 -0
- package/src/services/thinq/mqtt/mqttCertificate.ts +102 -0
- package/src/services/thinq/mqtt/mqttConnectionEvents.test.ts +276 -0
- package/src/services/thinq/mqtt/mqttConnectionEvents.ts +76 -0
- package/src/services/thinq/mqtt/mqttKeyRepository.test.ts +164 -0
- package/src/services/thinq/mqtt/mqttKeyRepository.ts +43 -0
- package/src/services/thinq/mqtt/mqttRetry.test.ts +239 -0
- package/src/services/thinq/mqtt/mqttRetry.ts +43 -0
- package/src/services/thinq/mqtt/thinqMqttListener.test.ts +349 -0
- package/src/services/thinq/mqtt/thinqMqttListener.ts +120 -0
- package/src/services/thinq/serviceContainer.test.ts +203 -0
- package/src/services/thinq/serviceContainer.ts +105 -0
- package/src/services/thinq/session.test.ts +287 -0
- package/src/services/thinq/session.ts +69 -0
- package/src/services/thinq/thinqApiClient.test.ts +702 -0
- package/src/services/thinq/thinqApiClient.ts +418 -0
- package/src/services/thinq/thinqDeviceService.test.ts +415 -0
- package/src/services/thinq/thinqDeviceService.ts +101 -0
- package/src/services/thinq/thinqFilterMonitoringService.test.ts +264 -0
- package/src/services/thinq/thinqFilterMonitoringService.ts +53 -0
- package/src/settings.ts +18 -0
- package/src/tests/cli/commands/devices.test.ts +293 -0
- package/src/tests/cli/commands/login.test.ts +240 -0
- package/src/tests/cli/help.test.ts +46 -0
- package/src/tests/cli/main.test.ts +214 -0
- package/src/tests/cli/session.test.ts +198 -0
- package/src/tests/cli/utils.test.ts +194 -0
- package/src/tests/core/domain/value-objects/AirConditionerCapabilities.test.ts +685 -0
- package/src/tests/core/domain/value-objects/ThinqFilterState.test.ts +210 -0
- package/src/tests/core/domain/value-objects/ThinqSnapshot.test.ts +1035 -0
- package/src/tests/helpers/testUtils.ts +118 -0
- package/src/tests/model/LgThinqPluginPlatformConfig.test.ts +81 -0
- package/src/tests/platform/deviceRegistry.test.ts +177 -0
- package/src/tests/platform/platformConfigManager.test.ts +790 -0
- package/src/tests/platform/platformState.test.ts +41 -0
- package/src/tests/platform/thinq/thinqAirConditionerCommandHandlers.test.ts +879 -0
- package/src/tests/platform/thinq/thinqAirConditionerEndpointFactory.test.ts +993 -0
- package/src/tests/platform/thinq/thinqAirConditionerFilterResetCommandHandler.test.ts +508 -0
- package/src/tests/platform/thinq/thinqAirConditionerFilterStateSync.test.ts +212 -0
- package/src/tests/platform/thinq/thinqAirConditionerStateSync.test.ts +1586 -0
- package/src/tests/platform/thinq/thinqDeviceConfigReconciler.test.ts +269 -0
- package/src/tests/platform/thinq/thinqDeviceConfigurator.test.ts +492 -0
- package/src/tests/platform/thinq/thinqWasherCommandHandlers.test.ts +594 -0
- package/src/tests/platform/thinq/thinqWasherEndpointFactory.test.ts +84 -0
- package/src/tests/platform/thinq/thinqWasherStateSync.test.ts +373 -0
- package/src/tests/platform/thinq/thinqWasherStopCommandResolver.test.ts +392 -0
- package/src/tests/settings.test.ts +33 -0
- package/src/utils/mask.ts +50 -0
- package/tsconfig.base.json +25 -0
- package/tsconfig.json +9 -0
- package/tsconfig.production.json +13 -0
- package/tsconfig.vitest.json +5 -0
- package/vite.config.ts +43 -0
- package/wiki/memory-archive.md +12 -0
- package/wiki/reference-workspaces.md +23 -0
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Matterbridge LG ThinQ Plugin",
|
|
3
|
+
"description": "matterbridge-lg-thinq-plugin v. 0.1.0 by https://github.com/RinDevJunior",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"name": {
|
|
7
|
+
"description": "Plugin name",
|
|
8
|
+
"type": "string",
|
|
9
|
+
"readOnly": true,
|
|
10
|
+
"ui:widget": "hidden"
|
|
11
|
+
},
|
|
12
|
+
"type": {
|
|
13
|
+
"description": "Plugin type",
|
|
14
|
+
"type": "string",
|
|
15
|
+
"readOnly": true,
|
|
16
|
+
"ui:widget": "hidden"
|
|
17
|
+
},
|
|
18
|
+
"thinq": {
|
|
19
|
+
"title": "LG ThinQ (cloud)",
|
|
20
|
+
"type": "object",
|
|
21
|
+
"properties": {
|
|
22
|
+
"loginType": {
|
|
23
|
+
"title": "Login Type",
|
|
24
|
+
"description": "Authenticate with a ThinQ account (username/password) or a pre-issued refresh token.",
|
|
25
|
+
"type": "string",
|
|
26
|
+
"enum": ["account", "token"],
|
|
27
|
+
"default": "account"
|
|
28
|
+
},
|
|
29
|
+
"country": {
|
|
30
|
+
"title": "Country",
|
|
31
|
+
"description": "ThinQ account country code (e.g. US, KR, GB).",
|
|
32
|
+
"type": "string",
|
|
33
|
+
"default": "US"
|
|
34
|
+
},
|
|
35
|
+
"language": {
|
|
36
|
+
"title": "Language",
|
|
37
|
+
"description": "ThinQ account language/locale (e.g. en-US, ko-KR).",
|
|
38
|
+
"type": "string",
|
|
39
|
+
"default": "en-US"
|
|
40
|
+
},
|
|
41
|
+
"refreshIntervalSeconds": {
|
|
42
|
+
"title": "Refresh Interval",
|
|
43
|
+
"description": "Device state refresh interval in seconds.",
|
|
44
|
+
"type": "number",
|
|
45
|
+
"default": 60,
|
|
46
|
+
"minimum": 1,
|
|
47
|
+
"maximum": 3600
|
|
48
|
+
},
|
|
49
|
+
"filterMonitoringIntervalSeconds": {
|
|
50
|
+
"title": "Filter Monitoring Interval",
|
|
51
|
+
"description": "Filter life state refresh interval in seconds (low frequency, filter life changes over days/weeks).",
|
|
52
|
+
"type": "number",
|
|
53
|
+
"default": 3600,
|
|
54
|
+
"minimum": 300,
|
|
55
|
+
"maximum": 86400
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"required": ["loginType", "country", "language"],
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"loginType": {
|
|
61
|
+
"if": {
|
|
62
|
+
"properties": {
|
|
63
|
+
"loginType": {
|
|
64
|
+
"const": "account"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"then": {
|
|
69
|
+
"properties": {
|
|
70
|
+
"username": {
|
|
71
|
+
"title": "ThinQ Account Username",
|
|
72
|
+
"description": "Email address or phone number used to sign in to LG ThinQ.",
|
|
73
|
+
"type": "string",
|
|
74
|
+
"minLength": 3
|
|
75
|
+
},
|
|
76
|
+
"password": {
|
|
77
|
+
"title": "ThinQ Account Password",
|
|
78
|
+
"description": "Password for your LG ThinQ account.",
|
|
79
|
+
"type": "string",
|
|
80
|
+
"ui:widget": "password"
|
|
81
|
+
},
|
|
82
|
+
"devices": {
|
|
83
|
+
"title": "ThinQ Devices",
|
|
84
|
+
"description": "Auto-populated on discovery. Per-device capability flags gate which Matter features are advertised.",
|
|
85
|
+
"type": "array",
|
|
86
|
+
"items": {
|
|
87
|
+
"type": "object",
|
|
88
|
+
"properties": {
|
|
89
|
+
"deviceId": {
|
|
90
|
+
"title": "Device ID",
|
|
91
|
+
"type": "string"
|
|
92
|
+
},
|
|
93
|
+
"deviceType": {
|
|
94
|
+
"title": "Device Type",
|
|
95
|
+
"type": "string",
|
|
96
|
+
"enum": ["AC", "WASHER"],
|
|
97
|
+
"readOnly": true
|
|
98
|
+
},
|
|
99
|
+
"productName": {
|
|
100
|
+
"title": "Product Name Override",
|
|
101
|
+
"description": "Override the Matter product name shown for this device. Only applied when Override Matter Configuration is enabled in Advanced Features.",
|
|
102
|
+
"type": "string"
|
|
103
|
+
},
|
|
104
|
+
"productId": {
|
|
105
|
+
"title": "Product ID Override",
|
|
106
|
+
"description": "Override the Matter product id shown for this device. Only applied when Override Matter Configuration is enabled in Advanced Features.",
|
|
107
|
+
"type": "number"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"required": ["deviceId"],
|
|
111
|
+
"dependencies": {
|
|
112
|
+
"deviceType": {
|
|
113
|
+
"allOf": [
|
|
114
|
+
{
|
|
115
|
+
"if": {
|
|
116
|
+
"properties": {
|
|
117
|
+
"deviceType": {
|
|
118
|
+
"const": "AC"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"then": {
|
|
123
|
+
"properties": {
|
|
124
|
+
"capabilities": {
|
|
125
|
+
"title": "Capabilities",
|
|
126
|
+
"type": "object",
|
|
127
|
+
"properties": {
|
|
128
|
+
"supportsHeat": {
|
|
129
|
+
"title": "Supports Heat",
|
|
130
|
+
"description": "Whether this device supports heating mode.",
|
|
131
|
+
"type": "boolean",
|
|
132
|
+
"default": true
|
|
133
|
+
},
|
|
134
|
+
"supportsFanSpeedControl": {
|
|
135
|
+
"title": "Supports Fan Speed Control",
|
|
136
|
+
"description": "Whether this device supports adjustable fan speed.",
|
|
137
|
+
"type": "boolean",
|
|
138
|
+
"default": true
|
|
139
|
+
},
|
|
140
|
+
"supportsSwingMode": {
|
|
141
|
+
"title": "Supports Swing Mode",
|
|
142
|
+
"description": "Whether this device supports swing mode (vertical/horizontal vane control).",
|
|
143
|
+
"type": "boolean",
|
|
144
|
+
"default": false
|
|
145
|
+
},
|
|
146
|
+
"supportsHumiditySensor": {
|
|
147
|
+
"title": "Supports Humidity Sensor",
|
|
148
|
+
"description": "Whether this device reports humidity data.",
|
|
149
|
+
"type": "boolean",
|
|
150
|
+
"default": false
|
|
151
|
+
},
|
|
152
|
+
"supportsAirQualitySensor": {
|
|
153
|
+
"title": "Supports Air-Quality Sensor",
|
|
154
|
+
"description": "Whether this device reports air-quality (AQI, PM2.5, PM10) data.",
|
|
155
|
+
"type": "boolean",
|
|
156
|
+
"default": false
|
|
157
|
+
},
|
|
158
|
+
"supportsEnergyMonitoring": {
|
|
159
|
+
"title": "Supports Energy Monitoring",
|
|
160
|
+
"description": "Whether this device reports instantaneous power consumption data.",
|
|
161
|
+
"type": "boolean",
|
|
162
|
+
"default": false
|
|
163
|
+
},
|
|
164
|
+
"supportsFilterMonitoring": {
|
|
165
|
+
"title": "Supports Filter Monitoring",
|
|
166
|
+
"description": "Whether this device reports air-filter life/remaining-percent data.",
|
|
167
|
+
"type": "boolean",
|
|
168
|
+
"default": false
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"if": {
|
|
177
|
+
"properties": {
|
|
178
|
+
"deviceType": {
|
|
179
|
+
"const": "WASHER"
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"then": {
|
|
184
|
+
"properties": {
|
|
185
|
+
"washerControl": {
|
|
186
|
+
"title": "Washer Control",
|
|
187
|
+
"type": "object",
|
|
188
|
+
"properties": {
|
|
189
|
+
"allowRemoteStop": {
|
|
190
|
+
"title": "Allow Remote Stop (Washer)",
|
|
191
|
+
"description": "Turning this on lets Apple Home send a real stop/cancel command to the physical washer. Off by default.",
|
|
192
|
+
"type": "boolean",
|
|
193
|
+
"default": false
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"if": {
|
|
202
|
+
"properties": {
|
|
203
|
+
"deviceType": {
|
|
204
|
+
"const": "AC"
|
|
205
|
+
},
|
|
206
|
+
"capabilities": {
|
|
207
|
+
"required": ["supportsFilterMonitoring"],
|
|
208
|
+
"properties": {
|
|
209
|
+
"supportsFilterMonitoring": {
|
|
210
|
+
"const": true
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
"required": ["capabilities"]
|
|
216
|
+
},
|
|
217
|
+
"then": {
|
|
218
|
+
"properties": {
|
|
219
|
+
"acFilterControl": {
|
|
220
|
+
"title": "AC Filter Control",
|
|
221
|
+
"type": "object",
|
|
222
|
+
"properties": {
|
|
223
|
+
"allowFilterReset": {
|
|
224
|
+
"title": "Allow Filter Reset (AC)",
|
|
225
|
+
"description": "Turning this on lets Apple Home send a real filter-counter reset command to the physical air conditioner, after you've replaced/cleaned the filter. Off by default. This command has not been live-tested yet — enable only when you are ready to verify it yourself.",
|
|
226
|
+
"type": "boolean",
|
|
227
|
+
"default": false
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
]
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
"required": ["username", "password"]
|
|
241
|
+
},
|
|
242
|
+
"else": {
|
|
243
|
+
"if": {
|
|
244
|
+
"properties": {
|
|
245
|
+
"loginType": {
|
|
246
|
+
"const": "token"
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
"then": {
|
|
251
|
+
"properties": {
|
|
252
|
+
"refreshToken": {
|
|
253
|
+
"title": "Refresh Token",
|
|
254
|
+
"description": "Pre-issued ThinQ refresh token, used instead of username/password.",
|
|
255
|
+
"type": "string",
|
|
256
|
+
"ui:widget": "password"
|
|
257
|
+
},
|
|
258
|
+
"devices": {
|
|
259
|
+
"title": "ThinQ Devices",
|
|
260
|
+
"description": "Auto-populated on discovery. Per-device capability flags gate which Matter features are advertised.",
|
|
261
|
+
"type": "array",
|
|
262
|
+
"items": {
|
|
263
|
+
"type": "object",
|
|
264
|
+
"properties": {
|
|
265
|
+
"deviceId": {
|
|
266
|
+
"title": "Device ID",
|
|
267
|
+
"type": "string"
|
|
268
|
+
},
|
|
269
|
+
"deviceType": {
|
|
270
|
+
"title": "Device Type",
|
|
271
|
+
"type": "string",
|
|
272
|
+
"enum": ["AC", "WASHER"],
|
|
273
|
+
"readOnly": true
|
|
274
|
+
},
|
|
275
|
+
"productName": {
|
|
276
|
+
"title": "Product Name Override",
|
|
277
|
+
"description": "Override the Matter product name shown for this device. Only applied when Override Matter Configuration is enabled in Advanced Features.",
|
|
278
|
+
"type": "string"
|
|
279
|
+
},
|
|
280
|
+
"productId": {
|
|
281
|
+
"title": "Product ID Override",
|
|
282
|
+
"description": "Override the Matter product id shown for this device. Only applied when Override Matter Configuration is enabled in Advanced Features.",
|
|
283
|
+
"type": "number"
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
"required": ["deviceId"],
|
|
287
|
+
"dependencies": {
|
|
288
|
+
"deviceType": {
|
|
289
|
+
"allOf": [
|
|
290
|
+
{
|
|
291
|
+
"if": {
|
|
292
|
+
"properties": {
|
|
293
|
+
"deviceType": {
|
|
294
|
+
"const": "AC"
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
"then": {
|
|
299
|
+
"properties": {
|
|
300
|
+
"capabilities": {
|
|
301
|
+
"title": "Capabilities",
|
|
302
|
+
"type": "object",
|
|
303
|
+
"properties": {
|
|
304
|
+
"supportsHeat": {
|
|
305
|
+
"title": "Supports Heat",
|
|
306
|
+
"description": "Whether this device supports heating mode.",
|
|
307
|
+
"type": "boolean",
|
|
308
|
+
"default": true
|
|
309
|
+
},
|
|
310
|
+
"supportsFanSpeedControl": {
|
|
311
|
+
"title": "Supports Fan Speed Control",
|
|
312
|
+
"description": "Whether this device supports adjustable fan speed.",
|
|
313
|
+
"type": "boolean",
|
|
314
|
+
"default": true
|
|
315
|
+
},
|
|
316
|
+
"supportsSwingMode": {
|
|
317
|
+
"title": "Supports Swing Mode",
|
|
318
|
+
"description": "Whether this device supports swing mode (vertical/horizontal vane control).",
|
|
319
|
+
"type": "boolean",
|
|
320
|
+
"default": false
|
|
321
|
+
},
|
|
322
|
+
"supportsHumiditySensor": {
|
|
323
|
+
"title": "Supports Humidity Sensor",
|
|
324
|
+
"description": "Whether this device reports humidity data.",
|
|
325
|
+
"type": "boolean",
|
|
326
|
+
"default": false
|
|
327
|
+
},
|
|
328
|
+
"supportsAirQualitySensor": {
|
|
329
|
+
"title": "Supports Air-Quality Sensor",
|
|
330
|
+
"description": "Whether this device reports air-quality (AQI, PM2.5, PM10) data.",
|
|
331
|
+
"type": "boolean",
|
|
332
|
+
"default": false
|
|
333
|
+
},
|
|
334
|
+
"supportsEnergyMonitoring": {
|
|
335
|
+
"title": "Supports Energy Monitoring",
|
|
336
|
+
"description": "Whether this device reports instantaneous power consumption data.",
|
|
337
|
+
"type": "boolean",
|
|
338
|
+
"default": false
|
|
339
|
+
},
|
|
340
|
+
"supportsFilterMonitoring": {
|
|
341
|
+
"title": "Supports Filter Monitoring",
|
|
342
|
+
"description": "Whether this device reports air-filter life/remaining-percent data.",
|
|
343
|
+
"type": "boolean",
|
|
344
|
+
"default": false
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"if": {
|
|
353
|
+
"properties": {
|
|
354
|
+
"deviceType": {
|
|
355
|
+
"const": "WASHER"
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
"then": {
|
|
360
|
+
"properties": {
|
|
361
|
+
"washerControl": {
|
|
362
|
+
"title": "Washer Control",
|
|
363
|
+
"type": "object",
|
|
364
|
+
"properties": {
|
|
365
|
+
"allowRemoteStop": {
|
|
366
|
+
"title": "Allow Remote Stop (Washer)",
|
|
367
|
+
"description": "Turning this on lets Apple Home send a real stop/cancel command to the physical washer. Off by default.",
|
|
368
|
+
"type": "boolean",
|
|
369
|
+
"default": false
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
"if": {
|
|
378
|
+
"properties": {
|
|
379
|
+
"deviceType": {
|
|
380
|
+
"const": "AC"
|
|
381
|
+
},
|
|
382
|
+
"capabilities": {
|
|
383
|
+
"required": ["supportsFilterMonitoring"],
|
|
384
|
+
"properties": {
|
|
385
|
+
"supportsFilterMonitoring": {
|
|
386
|
+
"const": true
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
"required": ["capabilities"]
|
|
392
|
+
},
|
|
393
|
+
"then": {
|
|
394
|
+
"properties": {
|
|
395
|
+
"acFilterControl": {
|
|
396
|
+
"title": "AC Filter Control",
|
|
397
|
+
"type": "object",
|
|
398
|
+
"properties": {
|
|
399
|
+
"allowFilterReset": {
|
|
400
|
+
"title": "Allow Filter Reset (AC)",
|
|
401
|
+
"description": "Turning this on lets Apple Home send a real filter-counter reset command to the physical air conditioner, after you've replaced/cleaned the filter. Off by default. This command has not been live-tested yet — enable only when you are ready to verify it yourself.",
|
|
402
|
+
"type": "boolean",
|
|
403
|
+
"default": false
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
]
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
},
|
|
416
|
+
"required": ["refreshToken"]
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
"webos": {
|
|
423
|
+
"title": "LG webOS TV (local network)",
|
|
424
|
+
"type": "object",
|
|
425
|
+
"properties": {
|
|
426
|
+
"devices": {
|
|
427
|
+
"title": "webOS TV Devices",
|
|
428
|
+
"description": "Populated once webOS pairing/control lands (Phase 3+).",
|
|
429
|
+
"type": "array",
|
|
430
|
+
"items": {
|
|
431
|
+
"type": "object"
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
"advancedFeature": {
|
|
437
|
+
"title": "Advanced features",
|
|
438
|
+
"type": "object",
|
|
439
|
+
"properties": {
|
|
440
|
+
"settings": {
|
|
441
|
+
"title": "Advanced Features Configuration",
|
|
442
|
+
"type": "object",
|
|
443
|
+
"properties": {
|
|
444
|
+
"debug": {
|
|
445
|
+
"title": "Enable Debug Mode",
|
|
446
|
+
"description": "Enable the debug for the plugin (development only)",
|
|
447
|
+
"type": "boolean",
|
|
448
|
+
"default": false
|
|
449
|
+
},
|
|
450
|
+
"clearStorageOnStartup": {
|
|
451
|
+
"title": "Clear Storage On Startup",
|
|
452
|
+
"description": "Clear persistence storage and re-initialize the plugin on next startup.",
|
|
453
|
+
"type": "boolean",
|
|
454
|
+
"default": false
|
|
455
|
+
},
|
|
456
|
+
"forceAuthentication": {
|
|
457
|
+
"title": "Force Authentication",
|
|
458
|
+
"description": "Ignore any cached/saved login session and always authenticate fresh on every start.",
|
|
459
|
+
"type": "boolean",
|
|
460
|
+
"default": false
|
|
461
|
+
},
|
|
462
|
+
"unregisterOnShutdown": {
|
|
463
|
+
"title": "Unregister On Shutdown",
|
|
464
|
+
"description": "Unregister all devices on shutdown (development only)",
|
|
465
|
+
"type": "boolean",
|
|
466
|
+
"default": false
|
|
467
|
+
},
|
|
468
|
+
"overrideMatterConfiguration": {
|
|
469
|
+
"title": "Override Matter Configuration",
|
|
470
|
+
"description": "Override the Matter vendor/product identity (vendor name, vendor id, product name, product id) shown for AC devices in Apple Home / any Matter controller.",
|
|
471
|
+
"type": "boolean",
|
|
472
|
+
"default": false
|
|
473
|
+
}
|
|
474
|
+
},
|
|
475
|
+
"required": [
|
|
476
|
+
"debug",
|
|
477
|
+
"clearStorageOnStartup",
|
|
478
|
+
"forceAuthentication",
|
|
479
|
+
"unregisterOnShutdown",
|
|
480
|
+
"overrideMatterConfiguration"
|
|
481
|
+
],
|
|
482
|
+
"dependencies": {
|
|
483
|
+
"overrideMatterConfiguration": {
|
|
484
|
+
"if": {
|
|
485
|
+
"properties": {
|
|
486
|
+
"overrideMatterConfiguration": {
|
|
487
|
+
"const": true
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
},
|
|
491
|
+
"then": {
|
|
492
|
+
"properties": {
|
|
493
|
+
"matterOverrideSettings": {
|
|
494
|
+
"title": "Matter Override Settings",
|
|
495
|
+
"type": "object",
|
|
496
|
+
"properties": {
|
|
497
|
+
"matterVendorName": {
|
|
498
|
+
"title": "Vendor Name",
|
|
499
|
+
"type": "string",
|
|
500
|
+
"default": "Matterbridge"
|
|
501
|
+
},
|
|
502
|
+
"matterVendorId": {
|
|
503
|
+
"title": "Vendor ID",
|
|
504
|
+
"type": "number",
|
|
505
|
+
"default": 65521
|
|
506
|
+
}
|
|
507
|
+
},
|
|
508
|
+
"required": ["matterVendorName", "matterVendorId"]
|
|
509
|
+
}
|
|
510
|
+
},
|
|
511
|
+
"required": ["matterOverrideSettings"]
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
"required": ["thinq", "webos", "advancedFeature"]
|
|
520
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "matterbridge-lg-thinq-plugin",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Matterbridge LG ThinQ Plugin",
|
|
5
|
+
"author": "https://github.com/RinDevJunior",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "https://github.com/RinDevJunior/matterbridge-lg-thinq-plugin",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"main": "dist/module.js",
|
|
10
|
+
"types": "dist/module.d.ts",
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/RinDevJunior/matterbridge-lg-thinq-plugin.git"
|
|
17
|
+
},
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/RinDevJunior/matterbridge-lg-thinq-plugin/issues"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"matterbridge",
|
|
23
|
+
"lg",
|
|
24
|
+
"thinq",
|
|
25
|
+
"webos",
|
|
26
|
+
"matter",
|
|
27
|
+
"matter.js",
|
|
28
|
+
"plugin",
|
|
29
|
+
"homekit",
|
|
30
|
+
"apple home"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"precommit": "npm run lint && npm run type-check && npm run dup-check && npm run format:check && npm run test",
|
|
34
|
+
"precommit:ci": "node scripts/run-precommit-summary.mjs",
|
|
35
|
+
"precondition": "npm install -g matterbridge@3.10.10",
|
|
36
|
+
"build:local": "npm run deepClean && npm install && npm link matterbridge && npm run build && npm run matterbridge:add",
|
|
37
|
+
"build:local:ci": "node scripts/run-build-local-summary.mjs",
|
|
38
|
+
"build:production": "tsc --project tsconfig.production.json",
|
|
39
|
+
"start": "tsc && matterbridge -childbridge",
|
|
40
|
+
"cli": "node dist/cli.js",
|
|
41
|
+
"dup-check": "npx jscpd",
|
|
42
|
+
"build": "tsc",
|
|
43
|
+
"type-check": "tsc --noEmit",
|
|
44
|
+
"type-check:ci": "tsc --noEmit >type-check.log 2>&1; node scripts/parse-tsc-failures.mjs",
|
|
45
|
+
"watch": "tsc --watch",
|
|
46
|
+
"test": "vitest run",
|
|
47
|
+
"test:file": "vitest run",
|
|
48
|
+
"test:coverage": "vitest run --coverage",
|
|
49
|
+
"test:report": "vitest run --reporter=junit --outputFile=test-report.junit.xml",
|
|
50
|
+
"test:ci": "vitest run --reporter=junit --outputFile=test-report.junit.xml >/dev/null 2>&1; node scripts/parse-junit-failures.mjs",
|
|
51
|
+
"lint": "eslint --max-warnings=0 .",
|
|
52
|
+
"lint:fix": "eslint --fix --max-warnings=0 .",
|
|
53
|
+
"lint:fix:ci": "node scripts/run-lint-fix-summary.mjs",
|
|
54
|
+
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,css,md}\"",
|
|
55
|
+
"format:ci": "node scripts/run-format-summary.mjs",
|
|
56
|
+
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,css,md}\"",
|
|
57
|
+
"deepClean": "npx rimraf tsconfig.tsbuildinfo npm-shrinkwrap.json ./dist ./node_modules",
|
|
58
|
+
"checkDependencies": "npx npm-check-updates",
|
|
59
|
+
"updateDependencies": "npx npm-check-updates -u && npm run build:local",
|
|
60
|
+
"matterbridge:add": "matterbridge -add .\\",
|
|
61
|
+
"matterbridge:remove": "matterbridge -remove .\\",
|
|
62
|
+
"matterbridge:enable": "matterbridge -enable .\\",
|
|
63
|
+
"matterbridge:disable": "matterbridge -disable .\\",
|
|
64
|
+
"matterbridge:list": "matterbridge -list",
|
|
65
|
+
"dev:link": "npm link matterbridge",
|
|
66
|
+
"dev:unlink": "npm unlink matterbridge"
|
|
67
|
+
},
|
|
68
|
+
"engines": {
|
|
69
|
+
"matterbridge": "^3.10.9",
|
|
70
|
+
"node": ">=24 <25"
|
|
71
|
+
},
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"@eslint/js": "10.0.1",
|
|
74
|
+
"@eslint/json": "^1.2.0",
|
|
75
|
+
"@eslint/markdown": "^8.0.1",
|
|
76
|
+
"@types/aws-iot-device-sdk": "^2.2.9",
|
|
77
|
+
"@types/node": "^26.1.0",
|
|
78
|
+
"@types/node-forge": "^1.3.14",
|
|
79
|
+
"@types/node-persist": "3.1.8",
|
|
80
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
81
|
+
"@vitest/eslint-plugin": "^1.6.21",
|
|
82
|
+
"axios-mock-adapter": "^2.1.0",
|
|
83
|
+
"eslint": "^10.6.0",
|
|
84
|
+
"eslint-config-prettier": "10.1.8",
|
|
85
|
+
"eslint-plugin-n": "^18.2.1",
|
|
86
|
+
"eslint-plugin-prettier": "^5.5.6",
|
|
87
|
+
"eslint-plugin-simple-import-sort": "^13.0.0",
|
|
88
|
+
"jscpd": "^4.0.8",
|
|
89
|
+
"mock-socket": "^9.3.1",
|
|
90
|
+
"npm-check-updates": "^20.0.0",
|
|
91
|
+
"prettier": "^3.9.4",
|
|
92
|
+
"rimraf": "^6.1.3",
|
|
93
|
+
"typescript": "6.0.3",
|
|
94
|
+
"typescript-eslint": "^8.62.1",
|
|
95
|
+
"vite-tsconfig-paths": "^6.1.1",
|
|
96
|
+
"vitest": "^4.1.10"
|
|
97
|
+
},
|
|
98
|
+
"dependencies": {
|
|
99
|
+
"aws-iot-device-sdk": "^2.2.16",
|
|
100
|
+
"axios": "^1.18.1",
|
|
101
|
+
"node-forge": "^1.4.0",
|
|
102
|
+
"node-persist": "^4.0.4"
|
|
103
|
+
},
|
|
104
|
+
"overrides": {
|
|
105
|
+
"typescript": "6.0.3"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
/*
|
|
3
|
+
|
|
4
|
+
prettier.config.js
|
|
5
|
+
|
|
6
|
+
Prettier:
|
|
7
|
+
|
|
8
|
+
How to install:
|
|
9
|
+
npm install --save-dev prettier eslint-config-prettier eslint-plugin-prettier
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
Add package.json scripts:
|
|
13
|
+
*/
|
|
14
|
+
// "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,css,md}\"",
|
|
15
|
+
// "format:check": "prettier --check \"src/**/*.{js,jsx,ts,tsx,json,css,md}\"",
|
|
16
|
+
|
|
17
|
+
/*
|
|
18
|
+
|
|
19
|
+
Add .prettierignore
|
|
20
|
+
|
|
21
|
+
# Ignore artifacts:
|
|
22
|
+
dist
|
|
23
|
+
node_modules
|
|
24
|
+
build
|
|
25
|
+
coverage
|
|
26
|
+
|
|
27
|
+
# Ignore all HTML files:
|
|
28
|
+
*/
|
|
29
|
+
// **/*.html
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
printWidth: 120, // default 80
|
|
33
|
+
tabWidth: 2,
|
|
34
|
+
useTabs: true,
|
|
35
|
+
semi: true,
|
|
36
|
+
singleQuote: true, // default false
|
|
37
|
+
quoteProps: 'preserve', // default 'as-needed'
|
|
38
|
+
jsxSingleQuote: false,
|
|
39
|
+
trailingComma: 'all',
|
|
40
|
+
bracketSpacing: true,
|
|
41
|
+
bracketSameLine: false,
|
|
42
|
+
arrowParens: 'always',
|
|
43
|
+
requirePragma: false,
|
|
44
|
+
insertPragma: false,
|
|
45
|
+
proseWrap: 'preserve',
|
|
46
|
+
endOfLine: 'lf',
|
|
47
|
+
embeddedLanguageFormatting: 'off', // default 'auto'
|
|
48
|
+
singleAttributePerLine: false,
|
|
49
|
+
};
|