@homebridge-plugins/homebridge-tuya 2.2.1 → 3.0.0-beta.1

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 (341) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +161 -144
  3. package/config.schema.json +976 -11
  4. package/dist/{core → cloud/api}/TuyaOpenAPI.js +6 -7
  5. package/dist/cloud/api/TuyaOpenAPI.js.map +1 -0
  6. package/dist/{core → cloud/api}/TuyaOpenMQ.js +13 -11
  7. package/dist/cloud/api/TuyaOpenMQ.js.map +1 -0
  8. package/dist/cloud/device/TuyaCustomDeviceManager.js.map +1 -0
  9. package/dist/{device → cloud/device}/TuyaDevice.js +14 -1
  10. package/dist/cloud/device/TuyaDevice.js.map +1 -0
  11. package/dist/{device → cloud/device}/TuyaDeviceManager.js +8 -3
  12. package/dist/cloud/device/TuyaDeviceManager.js.map +1 -0
  13. package/dist/cloud/device/TuyaHomeDeviceManager.js.map +1 -0
  14. package/dist/config.js +1 -0
  15. package/dist/config.js.map +1 -1
  16. package/dist/local/CloudLocalReconciliation.js +180 -0
  17. package/dist/local/CloudLocalReconciliation.js.map +1 -0
  18. package/dist/local/DynamicChildDiscovery.js +154 -0
  19. package/dist/local/DynamicChildDiscovery.js.map +1 -0
  20. package/dist/local/LocalDevice.js +419 -0
  21. package/dist/local/LocalDevice.js.map +1 -0
  22. package/dist/local/LocalDeviceManager.js +833 -0
  23. package/dist/local/LocalDeviceManager.js.map +1 -0
  24. package/dist/local/TuyaDiscovery.js +248 -0
  25. package/dist/local/TuyaDiscovery.js.map +1 -0
  26. package/dist/local/ZigbeeEventDetection.js +213 -0
  27. package/dist/local/ZigbeeEventDetection.js.map +1 -0
  28. package/dist/local/ZigbeeGatewayDetection.js +109 -0
  29. package/dist/local/ZigbeeGatewayDetection.js.map +1 -0
  30. package/dist/local/config.js +6 -0
  31. package/dist/local/config.js.map +1 -0
  32. package/dist/local/protocol/ChildPayloadUtility.js +94 -0
  33. package/dist/local/protocol/ChildPayloadUtility.js.map +1 -0
  34. package/dist/local/protocol/Protocol.js +3 -0
  35. package/dist/local/protocol/Protocol.js.map +1 -0
  36. package/dist/local/protocol/ProtocolFactory.js +27 -0
  37. package/dist/local/protocol/ProtocolFactory.js.map +1 -0
  38. package/dist/local/protocol/ProtocolUtilities.js +329 -0
  39. package/dist/local/protocol/ProtocolUtilities.js.map +1 -0
  40. package/dist/local/protocol/ProtocolV31V32.js +60 -0
  41. package/dist/local/protocol/ProtocolV31V32.js.map +1 -0
  42. package/dist/local/protocol/ProtocolV33.js +52 -0
  43. package/dist/local/protocol/ProtocolV33.js.map +1 -0
  44. package/dist/local/protocol/ProtocolV34.js +104 -0
  45. package/dist/local/protocol/ProtocolV34.js.map +1 -0
  46. package/dist/local/protocol/ProtocolV35.js +77 -0
  47. package/dist/local/protocol/ProtocolV35.js.map +1 -0
  48. package/dist/platform.js +149 -69
  49. package/dist/platform.js.map +1 -1
  50. package/dist/shared/AccessoryFactory.js +276 -0
  51. package/dist/shared/AccessoryFactory.js.map +1 -0
  52. package/dist/{accessory → shared/accessories}/AccessoryFactory.js +2 -2
  53. package/dist/shared/accessories/AccessoryFactory.js.map +1 -0
  54. package/dist/shared/accessories/AirConditionerAccessory.js.map +1 -0
  55. package/dist/{accessory → shared/accessories}/AirPurifierAccessory.js +1 -1
  56. package/dist/shared/accessories/AirPurifierAccessory.js.map +1 -0
  57. package/dist/shared/accessories/AirQualitySensorAccessory.js.map +1 -0
  58. package/dist/{accessory → shared/accessories}/BaseAccessory.js +99 -30
  59. package/dist/shared/accessories/BaseAccessory.js.map +1 -0
  60. package/dist/shared/accessories/BlindsAccessory.js +199 -0
  61. package/dist/shared/accessories/BlindsAccessory.js.map +1 -0
  62. package/dist/{accessory → shared/accessories}/CameraAccessory.js +7 -3
  63. package/dist/shared/accessories/CameraAccessory.js.map +1 -0
  64. package/dist/shared/accessories/CarbonDioxideSensorAccessory.js.map +1 -0
  65. package/dist/shared/accessories/CarbonMonoxideSensorAccessory.js.map +1 -0
  66. package/dist/shared/accessories/ContactSensorAccessory.js.map +1 -0
  67. package/dist/shared/accessories/DehumidifierAccessory.js.map +1 -0
  68. package/dist/shared/accessories/DiffuserAccessory.js.map +1 -0
  69. package/dist/shared/accessories/DimmerAccessory.js.map +1 -0
  70. package/dist/{accessory → shared/accessories}/DoorbellAccessory.js +3 -1
  71. package/dist/shared/accessories/DoorbellAccessory.js.map +1 -0
  72. package/dist/{accessory → shared/accessories}/ExtractionHoodAccessory.js +4 -2
  73. package/dist/shared/accessories/ExtractionHoodAccessory.js.map +1 -0
  74. package/dist/{accessory → shared/accessories}/FanAccessory.js +10 -4
  75. package/dist/shared/accessories/FanAccessory.js.map +1 -0
  76. package/dist/shared/accessories/GarageDoorAccessory.js.map +1 -0
  77. package/dist/shared/accessories/HeaterAccessory.js.map +1 -0
  78. package/dist/shared/accessories/HeaterAccessory_old.js.map +1 -0
  79. package/dist/shared/accessories/HumanPresenceSensorAccessory.js.map +1 -0
  80. package/dist/{accessory → shared/accessories}/HumidifierAccessory.js +3 -1
  81. package/dist/shared/accessories/HumidifierAccessory.js.map +1 -0
  82. package/dist/{accessory → shared/accessories}/IRAirConditionerAccessory.js +2 -2
  83. package/dist/shared/accessories/IRAirConditionerAccessory.js.map +1 -0
  84. package/dist/shared/accessories/IRControlHubAccessory.js.map +1 -0
  85. package/dist/shared/accessories/IRControlHubSubAccessory.js.map +1 -0
  86. package/dist/shared/accessories/IRGenericAccessory.js.map +1 -0
  87. package/dist/shared/accessories/LeakSensorAccessory.js.map +1 -0
  88. package/dist/shared/accessories/LightAccessory.js.map +1 -0
  89. package/dist/shared/accessories/LightSensorAccessory.js.map +1 -0
  90. package/dist/shared/accessories/LocationWeatherAccessory.js.map +1 -0
  91. package/dist/shared/accessories/LockAccessory.js.map +1 -0
  92. package/dist/shared/accessories/MotionSensorAccessory.js.map +1 -0
  93. package/dist/shared/accessories/OutletAccessory.js.map +1 -0
  94. package/dist/shared/accessories/PetFeederAccessory.js.map +1 -0
  95. package/dist/shared/accessories/SceneAccessory.js.map +1 -0
  96. package/dist/{accessory → shared/accessories}/SceneSwitchAccessory.js +1 -1
  97. package/dist/shared/accessories/SceneSwitchAccessory.js.map +1 -0
  98. package/dist/shared/accessories/SecuritySystemAccessory.js.map +1 -0
  99. package/dist/shared/accessories/SmokeSensorAccessory.js.map +1 -0
  100. package/dist/shared/accessories/SwitchAccessory.js +148 -0
  101. package/dist/shared/accessories/SwitchAccessory.js.map +1 -0
  102. package/dist/shared/accessories/TemperatureHumiditySensorAccessory.js.map +1 -0
  103. package/dist/shared/accessories/ThermostatAccessory.js.map +1 -0
  104. package/dist/shared/accessories/TowerRackAccessory.js.map +1 -0
  105. package/dist/{accessory → shared/accessories}/ValveAccessory.js +1 -1
  106. package/dist/shared/accessories/ValveAccessory.js.map +1 -0
  107. package/dist/{accessory → shared/accessories}/VibrationSensorAccessory.js +7 -3
  108. package/dist/shared/accessories/VibrationSensorAccessory.js.map +1 -0
  109. package/dist/shared/accessories/WeatherStationAccessory.js.map +1 -0
  110. package/dist/shared/accessories/WetBulbGlobeTemperatureAccessory.js.map +1 -0
  111. package/dist/shared/accessories/WhiteNoiseLightAccessory.js.map +1 -0
  112. package/dist/shared/accessories/WindowAccessory.js.map +1 -0
  113. package/dist/shared/accessories/WindowCoveringAccessory.js.map +1 -0
  114. package/dist/shared/accessories/WirelessSwitchAccessory.js.map +1 -0
  115. package/dist/shared/accessories/characteristic/Active.js.map +1 -0
  116. package/dist/{accessory → shared/accessories}/characteristic/AirQuality.js +1 -1
  117. package/dist/shared/accessories/characteristic/AirQuality.js.map +1 -0
  118. package/dist/shared/accessories/characteristic/CurrentRelativeHumidity.js.map +1 -0
  119. package/dist/shared/accessories/characteristic/CurrentTemperature.js.map +1 -0
  120. package/dist/shared/accessories/characteristic/CurrentWeather.js.map +1 -0
  121. package/dist/shared/accessories/characteristic/CurrentWeatherByOpenMeteo.js.map +1 -0
  122. package/dist/shared/accessories/characteristic/CurrentWetBulbGlobeTemperature.js.map +1 -0
  123. package/dist/shared/accessories/characteristic/EnergyUsage.js.map +1 -0
  124. package/dist/shared/accessories/characteristic/Light.js.map +1 -0
  125. package/dist/shared/accessories/characteristic/LightSensor.js.map +1 -0
  126. package/dist/shared/accessories/characteristic/LockPhysicalControls.js.map +1 -0
  127. package/dist/{accessory → shared/accessories}/characteristic/MotionDetected.js +1 -1
  128. package/dist/shared/accessories/characteristic/MotionDetected.js.map +1 -0
  129. package/dist/shared/accessories/characteristic/Name.js.map +1 -0
  130. package/dist/shared/accessories/characteristic/OccupancyDetected.js.map +1 -0
  131. package/dist/{accessory → shared/accessories}/characteristic/On.js +1 -1
  132. package/dist/shared/accessories/characteristic/On.js.map +1 -0
  133. package/dist/shared/accessories/characteristic/OutletInUse.js.map +1 -0
  134. package/dist/{accessory → shared/accessories}/characteristic/ProgrammableSwitchEvent.js +2 -2
  135. package/dist/shared/accessories/characteristic/ProgrammableSwitchEvent.js.map +1 -0
  136. package/dist/shared/accessories/characteristic/RelativeHumidityDehumidifierThreshold.js.map +1 -0
  137. package/dist/shared/accessories/characteristic/RotationSpeed.js.map +1 -0
  138. package/dist/shared/accessories/characteristic/SecuritySystemState.js.map +1 -0
  139. package/dist/shared/accessories/characteristic/SwingMode.js.map +1 -0
  140. package/dist/shared/accessories/characteristic/TargetTemperature.js.map +1 -0
  141. package/dist/shared/accessories/characteristic/TemperatureDisplayUnits.js.map +1 -0
  142. package/dist/shared/util/ConfigHash.js +79 -0
  143. package/dist/shared/util/ConfigHash.js.map +1 -0
  144. package/dist/shared/util/FfmpegStreamingProcess.js.map +1 -0
  145. package/dist/shared/util/InfraredTool.js.map +1 -0
  146. package/dist/shared/util/Logger.js.map +1 -0
  147. package/dist/shared/util/TuyaRecordingDelegate.js.map +1 -0
  148. package/dist/shared/util/TuyaStreamDelegate.js.map +1 -0
  149. package/dist/shared/util/color.js.map +1 -0
  150. package/dist/shared/util/util.js +135 -0
  151. package/dist/shared/util/util.js.map +1 -0
  152. package/eslint.config.mjs +52 -0
  153. package/jest.config.js +6 -0
  154. package/package.json +22 -27
  155. package/test/__mocks__/@homebridge-camera-utils.js +10 -0
  156. package/test/__mocks__/color-convert.js +24 -0
  157. package/test/__mocks__/kelvin-to-rgb.js +21 -0
  158. package/test/accessoryFactory.test.ts +522 -0
  159. package/test/config.test.ts +430 -0
  160. package/test/custom.test.ts +4 -4
  161. package/test/errorHandling.test.ts +570 -0
  162. package/test/errorHandlingCoverage.test.ts +410 -0
  163. package/test/home.test.ts +4 -4
  164. package/test/localDevice.test.ts +616 -0
  165. package/test/localDeviceManager.behavior.test.ts +185 -0
  166. package/test/localDeviceManager.test.ts +268 -0
  167. package/test/mqttMessages.test.ts +495 -0
  168. package/test/platform.test.ts +515 -0
  169. package/test/platform.validation.local.test.ts +250 -0
  170. package/test/protocol.test.ts +446 -0
  171. package/test/protocolUtilities.test.ts +351 -0
  172. package/test/sanitizeName.test.ts +2 -1
  173. package/test/tuyaCustomDeviceManager.test.ts +469 -0
  174. package/test/tuyaDevice.test.ts +425 -0
  175. package/test/tuyaDeviceManager.test.ts +813 -0
  176. package/test/tuyaDiscovery.test.ts +439 -0
  177. package/test/tuyaHomeDeviceManager.test.ts +540 -0
  178. package/test/tuyaOpenAPI.test.ts +404 -0
  179. package/test/tuyaOpenMQ.test.ts +444 -0
  180. package/test/util.test.ts +318 -0
  181. package/test/util.ts +4 -3
  182. package/test/zigbee/ChildPayloadUtility.test.ts +199 -0
  183. package/test/zigbee/CloudLocalReconciliation.test.ts +284 -0
  184. package/test/zigbee/DynamicChildDiscovery.test.ts +333 -0
  185. package/test/zigbee/LocalDevice.zigbee.test.ts +274 -0
  186. package/test/zigbee/LocalDeviceManager.cloud-discovery.test.ts +163 -0
  187. package/test/zigbee/LocalDeviceManager.zigbee.reconnect.test.ts +200 -0
  188. package/test/zigbee/LocalDeviceManager.zigbee.test.ts +344 -0
  189. package/test/zigbee/ZigbeeEventDetection.test.ts +418 -0
  190. package/test/zigbee/ZigbeeGatewayDetection.test.ts +222 -0
  191. package/tuya-local-configs/dev-1.hash +1 -0
  192. package/tuya-local-configs/device1.hash +1 -0
  193. package/wiki/Get-Local-Keys-for-Your-Devices.md +85 -0
  194. package/dist/accessory/AccessoryFactory.js.map +0 -1
  195. package/dist/accessory/AirConditionerAccessory.js.map +0 -1
  196. package/dist/accessory/AirPurifierAccessory.js.map +0 -1
  197. package/dist/accessory/AirQualitySensorAccessory.js.map +0 -1
  198. package/dist/accessory/BaseAccessory.js.map +0 -1
  199. package/dist/accessory/CameraAccessory.js.map +0 -1
  200. package/dist/accessory/CarbonDioxideSensorAccessory.js.map +0 -1
  201. package/dist/accessory/CarbonMonoxideSensorAccessory.js.map +0 -1
  202. package/dist/accessory/ContactSensorAccessory.js.map +0 -1
  203. package/dist/accessory/DehumidifierAccessory.js.map +0 -1
  204. package/dist/accessory/DiffuserAccessory.js.map +0 -1
  205. package/dist/accessory/DimmerAccessory.js.map +0 -1
  206. package/dist/accessory/DoorbellAccessory.js.map +0 -1
  207. package/dist/accessory/ExtractionHoodAccessory.js.map +0 -1
  208. package/dist/accessory/FanAccessory.js.map +0 -1
  209. package/dist/accessory/GarageDoorAccessory.js.map +0 -1
  210. package/dist/accessory/HeaterAccessory.js.map +0 -1
  211. package/dist/accessory/HeaterAccessory_old.js.map +0 -1
  212. package/dist/accessory/HumanPresenceSensorAccessory.js.map +0 -1
  213. package/dist/accessory/HumidifierAccessory.js.map +0 -1
  214. package/dist/accessory/IRAirConditionerAccessory.js.map +0 -1
  215. package/dist/accessory/IRControlHubAccessory.js.map +0 -1
  216. package/dist/accessory/IRControlHubSubAccessory.js.map +0 -1
  217. package/dist/accessory/IRGenericAccessory.js.map +0 -1
  218. package/dist/accessory/LeakSensorAccessory.js.map +0 -1
  219. package/dist/accessory/LightAccessory.js.map +0 -1
  220. package/dist/accessory/LightSensorAccessory.js.map +0 -1
  221. package/dist/accessory/LocationWeatherAccessory.js.map +0 -1
  222. package/dist/accessory/LockAccessory.js.map +0 -1
  223. package/dist/accessory/MotionSensorAccessory.js.map +0 -1
  224. package/dist/accessory/OutletAccessory.js.map +0 -1
  225. package/dist/accessory/PetFeederAccessory.js.map +0 -1
  226. package/dist/accessory/SceneAccessory.js.map +0 -1
  227. package/dist/accessory/SceneSwitchAccessory.js.map +0 -1
  228. package/dist/accessory/SecuritySystemAccessory.js.map +0 -1
  229. package/dist/accessory/SmokeSensorAccessory.js.map +0 -1
  230. package/dist/accessory/SwitchAccessory.js +0 -85
  231. package/dist/accessory/SwitchAccessory.js.map +0 -1
  232. package/dist/accessory/TemperatureHumiditySensorAccessory.js.map +0 -1
  233. package/dist/accessory/ThermostatAccessory.js.map +0 -1
  234. package/dist/accessory/TowerRackAccessory.js.map +0 -1
  235. package/dist/accessory/ValveAccessory.js.map +0 -1
  236. package/dist/accessory/VibrationSensorAccessory.js.map +0 -1
  237. package/dist/accessory/WeatherStationAccessory.js.map +0 -1
  238. package/dist/accessory/WetBulbGlobeTemperatureAccessory.js.map +0 -1
  239. package/dist/accessory/WhiteNoiseLightAccessory.js.map +0 -1
  240. package/dist/accessory/WindowAccessory.js.map +0 -1
  241. package/dist/accessory/WindowCoveringAccessory.js.map +0 -1
  242. package/dist/accessory/WirelessSwitchAccessory.js.map +0 -1
  243. package/dist/accessory/characteristic/Active.js.map +0 -1
  244. package/dist/accessory/characteristic/AirQuality.js.map +0 -1
  245. package/dist/accessory/characteristic/CurrentRelativeHumidity.js.map +0 -1
  246. package/dist/accessory/characteristic/CurrentTemperature.js.map +0 -1
  247. package/dist/accessory/characteristic/CurrentWeather.js.map +0 -1
  248. package/dist/accessory/characteristic/CurrentWeatherByOpenMeteo.js.map +0 -1
  249. package/dist/accessory/characteristic/CurrentWetBulbGlobeTemperature.js.map +0 -1
  250. package/dist/accessory/characteristic/EnergyUsage.js.map +0 -1
  251. package/dist/accessory/characteristic/Light.js.map +0 -1
  252. package/dist/accessory/characteristic/LightSensor.js.map +0 -1
  253. package/dist/accessory/characteristic/LockPhysicalControls.js.map +0 -1
  254. package/dist/accessory/characteristic/MotionDetected.js.map +0 -1
  255. package/dist/accessory/characteristic/Name.js.map +0 -1
  256. package/dist/accessory/characteristic/OccupancyDetected.js.map +0 -1
  257. package/dist/accessory/characteristic/On.js.map +0 -1
  258. package/dist/accessory/characteristic/OutletInUse.js.map +0 -1
  259. package/dist/accessory/characteristic/ProgrammableSwitchEvent.js.map +0 -1
  260. package/dist/accessory/characteristic/RelativeHumidityDehumidifierThreshold.js.map +0 -1
  261. package/dist/accessory/characteristic/RotationSpeed.js.map +0 -1
  262. package/dist/accessory/characteristic/SecuritySystemState.js.map +0 -1
  263. package/dist/accessory/characteristic/SwingMode.js.map +0 -1
  264. package/dist/accessory/characteristic/TargetTemperature.js.map +0 -1
  265. package/dist/accessory/characteristic/TemperatureDisplayUnits.js.map +0 -1
  266. package/dist/core/TuyaOpenAPI.js.map +0 -1
  267. package/dist/core/TuyaOpenMQ.js.map +0 -1
  268. package/dist/device/TuyaCustomDeviceManager.js.map +0 -1
  269. package/dist/device/TuyaDevice.js.map +0 -1
  270. package/dist/device/TuyaDeviceManager.js.map +0 -1
  271. package/dist/device/TuyaHomeDeviceManager.js.map +0 -1
  272. package/dist/util/FfmpegStreamingProcess.js.map +0 -1
  273. package/dist/util/InfraredTool.js.map +0 -1
  274. package/dist/util/Logger.js.map +0 -1
  275. package/dist/util/TuyaRecordingDelegate.js.map +0 -1
  276. package/dist/util/TuyaStreamDelegate.js.map +0 -1
  277. package/dist/util/color.js.map +0 -1
  278. package/dist/util/util.js +0 -63
  279. package/dist/util/util.js.map +0 -1
  280. /package/dist/{device → cloud/device}/TuyaCustomDeviceManager.js +0 -0
  281. /package/dist/{device → cloud/device}/TuyaHomeDeviceManager.js +0 -0
  282. /package/dist/{accessory → shared/accessories}/AirConditionerAccessory.js +0 -0
  283. /package/dist/{accessory → shared/accessories}/AirQualitySensorAccessory.js +0 -0
  284. /package/dist/{accessory → shared/accessories}/CarbonDioxideSensorAccessory.js +0 -0
  285. /package/dist/{accessory → shared/accessories}/CarbonMonoxideSensorAccessory.js +0 -0
  286. /package/dist/{accessory → shared/accessories}/ContactSensorAccessory.js +0 -0
  287. /package/dist/{accessory → shared/accessories}/DehumidifierAccessory.js +0 -0
  288. /package/dist/{accessory → shared/accessories}/DiffuserAccessory.js +0 -0
  289. /package/dist/{accessory → shared/accessories}/DimmerAccessory.js +0 -0
  290. /package/dist/{accessory → shared/accessories}/GarageDoorAccessory.js +0 -0
  291. /package/dist/{accessory → shared/accessories}/HeaterAccessory.js +0 -0
  292. /package/dist/{accessory → shared/accessories}/HeaterAccessory_old.js +0 -0
  293. /package/dist/{accessory → shared/accessories}/HumanPresenceSensorAccessory.js +0 -0
  294. /package/dist/{accessory → shared/accessories}/IRControlHubAccessory.js +0 -0
  295. /package/dist/{accessory → shared/accessories}/IRControlHubSubAccessory.js +0 -0
  296. /package/dist/{accessory → shared/accessories}/IRGenericAccessory.js +0 -0
  297. /package/dist/{accessory → shared/accessories}/LeakSensorAccessory.js +0 -0
  298. /package/dist/{accessory → shared/accessories}/LightAccessory.js +0 -0
  299. /package/dist/{accessory → shared/accessories}/LightSensorAccessory.js +0 -0
  300. /package/dist/{accessory → shared/accessories}/LocationWeatherAccessory.js +0 -0
  301. /package/dist/{accessory → shared/accessories}/LockAccessory.js +0 -0
  302. /package/dist/{accessory → shared/accessories}/MotionSensorAccessory.js +0 -0
  303. /package/dist/{accessory → shared/accessories}/OutletAccessory.js +0 -0
  304. /package/dist/{accessory → shared/accessories}/PetFeederAccessory.js +0 -0
  305. /package/dist/{accessory → shared/accessories}/SceneAccessory.js +0 -0
  306. /package/dist/{accessory → shared/accessories}/SecuritySystemAccessory.js +0 -0
  307. /package/dist/{accessory → shared/accessories}/SmokeSensorAccessory.js +0 -0
  308. /package/dist/{accessory → shared/accessories}/TemperatureHumiditySensorAccessory.js +0 -0
  309. /package/dist/{accessory → shared/accessories}/ThermostatAccessory.js +0 -0
  310. /package/dist/{accessory → shared/accessories}/TowerRackAccessory.js +0 -0
  311. /package/dist/{accessory → shared/accessories}/WeatherStationAccessory.js +0 -0
  312. /package/dist/{accessory → shared/accessories}/WetBulbGlobeTemperatureAccessory.js +0 -0
  313. /package/dist/{accessory → shared/accessories}/WhiteNoiseLightAccessory.js +0 -0
  314. /package/dist/{accessory → shared/accessories}/WindowAccessory.js +0 -0
  315. /package/dist/{accessory → shared/accessories}/WindowCoveringAccessory.js +0 -0
  316. /package/dist/{accessory → shared/accessories}/WirelessSwitchAccessory.js +0 -0
  317. /package/dist/{accessory → shared/accessories}/characteristic/Active.js +0 -0
  318. /package/dist/{accessory → shared/accessories}/characteristic/CurrentRelativeHumidity.js +0 -0
  319. /package/dist/{accessory → shared/accessories}/characteristic/CurrentTemperature.js +0 -0
  320. /package/dist/{accessory → shared/accessories}/characteristic/CurrentWeather.js +0 -0
  321. /package/dist/{accessory → shared/accessories}/characteristic/CurrentWeatherByOpenMeteo.js +0 -0
  322. /package/dist/{accessory → shared/accessories}/characteristic/CurrentWetBulbGlobeTemperature.js +0 -0
  323. /package/dist/{accessory → shared/accessories}/characteristic/EnergyUsage.js +0 -0
  324. /package/dist/{accessory → shared/accessories}/characteristic/Light.js +0 -0
  325. /package/dist/{accessory → shared/accessories}/characteristic/LightSensor.js +0 -0
  326. /package/dist/{accessory → shared/accessories}/characteristic/LockPhysicalControls.js +0 -0
  327. /package/dist/{accessory → shared/accessories}/characteristic/Name.js +0 -0
  328. /package/dist/{accessory → shared/accessories}/characteristic/OccupancyDetected.js +0 -0
  329. /package/dist/{accessory → shared/accessories}/characteristic/OutletInUse.js +0 -0
  330. /package/dist/{accessory → shared/accessories}/characteristic/RelativeHumidityDehumidifierThreshold.js +0 -0
  331. /package/dist/{accessory → shared/accessories}/characteristic/RotationSpeed.js +0 -0
  332. /package/dist/{accessory → shared/accessories}/characteristic/SecuritySystemState.js +0 -0
  333. /package/dist/{accessory → shared/accessories}/characteristic/SwingMode.js +0 -0
  334. /package/dist/{accessory → shared/accessories}/characteristic/TargetTemperature.js +0 -0
  335. /package/dist/{accessory → shared/accessories}/characteristic/TemperatureDisplayUnits.js +0 -0
  336. /package/dist/{util → shared/util}/FfmpegStreamingProcess.js +0 -0
  337. /package/dist/{util → shared/util}/InfraredTool.js +0 -0
  338. /package/dist/{util → shared/util}/Logger.js +0 -0
  339. /package/dist/{util → shared/util}/TuyaRecordingDelegate.js +0 -0
  340. /package/dist/{util → shared/util}/TuyaStreamDelegate.js +0 -0
  341. /package/dist/{util → shared/util}/color.js +0 -0
@@ -2,26 +2,641 @@
2
2
  "pluginAlias": "TuyaPlatform",
3
3
  "pluginType": "platform",
4
4
  "singular": true,
5
- "headerDisplay": "",
5
+ "headerDisplay": "<p align='center'><img height='60px' src='https://user-images.githubusercontent.com/3979615/78354049-dc7ff780-75f6-11ea-8026-2f8bf81d8331.png'></p>",
6
6
  "footerDisplay": "",
7
7
  "customUi": false,
8
8
  "schema": {
9
9
  "type": "object",
10
+ "required": ["mode"],
10
11
  "properties": {
11
12
  "name": {
12
13
  "type": "string",
13
14
  "title": "Name",
14
15
  "default": "Tuya"
15
16
  },
17
+ "mode": {
18
+ "title": "Connection Mode",
19
+ "description": "How the plugin connects to your devices. Use <strong>Cloud</strong> for the standard Tuya Cloud API, <strong>Local</strong> for direct LAN communication (no cloud needed), or <strong>Both</strong> to run cloud and local simultaneously.",
20
+ "type": "string",
21
+ "default": "cloud",
22
+ "oneOf": [
23
+ { "title": "Cloud (Tuya OpenAPI)", "enum": ["cloud"] },
24
+ { "title": "Local (LAN / direct TCP)", "enum": ["local"] },
25
+ { "title": "Both (Cloud + Local)", "enum": ["both"] }
26
+ ]
27
+ },
28
+ "local": {
29
+ "title": "Local Settings",
30
+ "description": "Configure local LAN devices. For help getting local keys, see the <a href='#' onClick='alert(\"Visit: wiki/Get-Local-Keys-for-Your-Devices.md\")'>Local Keys Setup Guide</a>.",
31
+ "type": "object",
32
+ "condition": {
33
+ "functionBody": "return (model.mode === 'local' || model.mode === 'both');"
34
+ },
35
+ "properties": {
36
+ "autoDiscoverDevices": {
37
+ "title": "Auto-Discover Devices",
38
+ "description": "Automatically find Tuya devices on the local network via UDP broadcast.",
39
+ "type": "boolean",
40
+ "default": true
41
+ },
42
+ "discoverTimeout": {
43
+ "title": "Discovery Timeout (seconds)",
44
+ "description": "How long to listen for UDP broadcast replies. Default: 5 seconds.",
45
+ "type": "integer",
46
+ "default": 5,
47
+ "minimum": 1,
48
+ "maximum": 60
49
+ },
50
+ "rediscoverInterval": {
51
+ "title": "Rediscovery Interval (seconds)",
52
+ "description": "How often to re-run device discovery to detect devices that go offline and return (e.g. after WiFi reset or IP change). Set to 0 to disable. Default: 900 seconds (15 minutes).",
53
+ "type": "integer",
54
+ "default": 900,
55
+ "minimum": 0,
56
+ "maximum": 3600
57
+ },
58
+ "devices": {
59
+ "title": "Manual Devices",
60
+ "description": "List individual devices if auto-discovery does not find them or if you want to provide a local key.",
61
+ "type": "array",
62
+ "default": [],
63
+ "items": {
64
+ "type": "object",
65
+ "properties": {
66
+ "category": {
67
+ "title": "Type",
68
+ "description": "Select the device type or category code for proper accessory type detection.",
69
+ "type": "string",
70
+ "default": "",
71
+ "oneOf": [
72
+ { "title": "Please select device type...", "enum": [""] },
73
+ { "title": "Light / Smart Bulb", "enum": ["dj"] },
74
+ { "title": "Dimmer", "enum": ["tgq"] },
75
+ { "title": "Smart Switch", "enum": ["dlq"] },
76
+ { "title": "Smart Outlet / Power Strip", "enum": ["cz"] },
77
+ { "title": "Wireless Remote Switch", "enum": ["wxkg"] },
78
+ { "title": "Scene Switch", "enum": ["cjkg"] },
79
+ { "title": "Air Conditioner", "enum": ["kt"] },
80
+ { "title": "Heater / Convector", "enum": ["qn"] },
81
+ { "title": "Air Purifier", "enum": ["kj"] },
82
+ { "title": "Humidifier / Diffuser", "enum": ["xxj"] },
83
+ { "title": "Garage Door", "enum": ["ckmkzq"] },
84
+ { "title": "Window Covering / Blind", "enum": ["cl"] },
85
+ { "title": "Smart Lock", "enum": ["ms"] },
86
+ { "title": "Window / Door Sensor", "enum": ["mc"] },
87
+ { "title": "Contact Sensor", "enum": ["hj"] },
88
+ { "title": "Leak Sensor", "enum": ["yc"] },
89
+ { "title": "Motion Sensor", "enum": ["pir"] },
90
+ { "title": "Smoke Sensor", "enum": ["yw"] },
91
+ { "title": "Temperature/Humidity Sensor", "enum": ["wsdcz"] },
92
+ { "title": "Light Sensor", "enum": ["gd"] },
93
+ { "title": "Air Quality Sensor", "enum": ["kqbj"] },
94
+ { "title": "Thermostat", "enum": ["wk"] },
95
+ { "title": "Towel Rack / Warmer", "enum": ["mjj"] },
96
+ { "title": "Fan", "enum": ["fs"] },
97
+ { "title": "Doorbell / Camera", "enum": ["mb"] },
98
+ { "title": "Pet Feeder", "enum": ["cwwsq"] },
99
+ { "title": "Security System", "enum": ["aq"] },
100
+ { "title": "Custom / Other", "enum": ["other"] }
101
+ ]
102
+ },
103
+ "tuyaDeviceId": {
104
+ "title": "Device ID",
105
+ "description": "The Tuya device ID (same as the cloud device ID).",
106
+ "type": "string",
107
+ "condition": {
108
+ "functionBody": "return model.local && model.local.devices && model.local.devices[arrayIndices[0]] && model.local.devices[arrayIndices[0]].category !== '';"
109
+ }
110
+ },
111
+ "tuyaKey": {
112
+ "title": "Local Key",
113
+ "description": "The 16-character AES local key for direct communication.",
114
+ "type": "string",
115
+ "condition": {
116
+ "functionBody": "return model.local && model.local.devices && model.local.devices[arrayIndices[0]] && model.local.devices[arrayIndices[0]].category !== '';"
117
+ }
118
+ },
119
+ "ip": {
120
+ "title": "IP Address",
121
+ "description": "Fixed IP address. Leave blank to use auto-discovery.",
122
+ "type": "string",
123
+ "condition": {
124
+ "functionBody": "return model.local && model.local.devices && model.local.devices[arrayIndices[0]] && model.local.devices[arrayIndices[0]].category !== '';"
125
+ }
126
+ },
127
+ "name": {
128
+ "title": "Name",
129
+ "description": "Anything you'd like to use to identify this device.",
130
+ "type": "string",
131
+ "condition": {
132
+ "functionBody": "return model.local && model.local.devices && model.local.devices[arrayIndices[0]] && model.local.devices[arrayIndices[0]].category !== '';"
133
+ }
134
+ },
135
+ "protocolVersion": {
136
+ "title": "Protocol Version",
137
+ "description": "Tuya local protocol version. Leave blank to auto-detect.",
138
+ "type": "string",
139
+ "condition": {
140
+ "functionBody": "return model.local && model.local.devices && model.local.devices[arrayIndices[0]] && model.local.devices[arrayIndices[0]].category !== '';"
141
+ }
142
+ },
143
+ "dpMapping": {
144
+ "title": "Custom DP Mapping (Advanced)",
145
+ "description": "Override default DP-to-function mappings as JSON. Example: {\"switch_1\": 1, \"bright_value\": 2, \"temp_value\": 3}",
146
+ "type": "object",
147
+ "additionalProperties": {
148
+ "type": "integer"
149
+ },
150
+ "condition": {
151
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) && ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) !== '';"
152
+ }
153
+ },
154
+ "outletCount": {
155
+ "type": "integer",
156
+ "title": "Outlet Count",
157
+ "placeholder": 5,
158
+ "condition": {
159
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cz' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'pc' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'wkcz';"
160
+ }
161
+ },
162
+ "isZigbeeGateway": {
163
+ "title": "Zigbee Gateway",
164
+ "description": "Mark this device as a Zigbee gateway. Usually auto-detected if other devices reference this device as their parent.",
165
+ "type": "boolean",
166
+ "default": false
167
+ },
168
+ "parentDeviceId": {
169
+ "title": "Parent Gateway Device ID",
170
+ "description": "For Zigbee sub-devices: the Tuya device ID of the parent gateway. Commands are routed through the parent's TCP connection using the Zigbee CID.",
171
+ "type": "string"
172
+ },
173
+ "zigbeeChildId": {
174
+ "title": "Zigbee Child ID (CID)",
175
+ "description": "For Zigbee sub-devices: the 16-character hex node ID assigned by the gateway (e.g. '0011223344556601'). Required when parentDeviceId is set.",
176
+ "type": "string",
177
+ "pattern": "^[0-9a-fA-F]{16}$"
178
+ },
179
+ "childDpMapping": {
180
+ "title": "Child DP Mapping (Override)",
181
+ "description": "For Zigbee sub-devices: optional DP mapping override. If provided, replaces the parent's DP mapping for this child device. Useful when child DPs differ from the gateway.",
182
+ "type": "object",
183
+ "additionalProperties": {
184
+ "type": "integer"
185
+ },
186
+ "condition": {
187
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].parentDeviceId : undefined) !== undefined && ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].parentDeviceId : undefined) !== '';"
188
+ }
189
+ },
190
+ "childCategory": {
191
+ "title": "Child Category Override",
192
+ "description": "For Zigbee sub-devices: optional category override. If provided, replaces the parent's category for this child device. Useful when child is a different device type than the gateway.",
193
+ "type": "string",
194
+ "condition": {
195
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].parentDeviceId : undefined) !== undefined && ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].parentDeviceId : undefined) !== '';"
196
+ }
197
+ },
198
+ "outlets": {
199
+ "type": "array",
200
+ "title": "Outlets",
201
+ "orderable": false,
202
+ "items": {
203
+ "type": "object",
204
+ "properties": {
205
+ "name": {
206
+ "type": "string"
207
+ },
208
+ "dp": {
209
+ "type": "integer"
210
+ }
211
+ }
212
+ },
213
+ "condition": {
214
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cz' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'pc' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'wkcz';"
215
+ }
216
+ },
217
+ "dpPower": {
218
+ "type": "integer",
219
+ "title": "Power DP",
220
+ "placeholder": 1,
221
+ "condition": {
222
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cz' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'pc' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'wkcz' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dj' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dsd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'xdd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgkg';"
223
+ }
224
+ },
225
+ "dpBrightness": {
226
+ "type": "integer",
227
+ "title": "Brightness DP",
228
+ "placeholder": 2,
229
+ "condition": {
230
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dj' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dsd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'xdd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgkg' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'fs';"
231
+ }
232
+ },
233
+ "dpColorTemperature": {
234
+ "type": "integer",
235
+ "title": "Color Temperature DP",
236
+ "placeholder": 3,
237
+ "condition": {
238
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dj' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dsd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'xdd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgkg' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'fs';"
239
+ }
240
+ },
241
+ "minWhiteColor": {
242
+ "type": "integer",
243
+ "title": "Min White Color",
244
+ "placeholder": 140,
245
+ "condition": {
246
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dj' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dsd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'xdd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgkg';"
247
+ }
248
+ },
249
+ "maxWhiteColor": {
250
+ "type": "integer",
251
+ "title": "Max White Color",
252
+ "placeholder": 400,
253
+ "condition": {
254
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dj' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dsd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'xdd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgkg';"
255
+ }
256
+ },
257
+ "dpMode": {
258
+ "type": "integer",
259
+ "title": "Mode DP",
260
+ "placeholder": 2,
261
+ "condition": {
262
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dj' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dsd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'xdd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgkg';"
263
+ }
264
+ },
265
+ "dpColor": {
266
+ "type": "integer",
267
+ "title": "Color DP",
268
+ "placeholder": 5,
269
+ "condition": {
270
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dj' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dsd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'xdd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgkg';"
271
+ }
272
+ },
273
+ "colorFunction": {
274
+ "type": "string",
275
+ "title": "Color Function",
276
+ "placeholder": "HEXHSB",
277
+ "condition": {
278
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dj' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dsd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'xdd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgkg';"
279
+ }
280
+ },
281
+ "scaleBrightness": {
282
+ "type": "integer",
283
+ "title": "Scale Brightness",
284
+ "placeholder": 255,
285
+ "condition": {
286
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dj' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dsd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'xdd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgkg' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'fs';"
287
+ }
288
+ },
289
+ "scaleWhiteColor": {
290
+ "type": "integer",
291
+ "title": "Scale White Color",
292
+ "placeholder": 255,
293
+ "condition": {
294
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dj' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dsd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'xdd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgkg';"
295
+ }
296
+ },
297
+ "voltsId": {
298
+ "type": "integer",
299
+ "title": "Voltage DP",
300
+ "placeholder": 9,
301
+ "condition": {
302
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cz' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'pc' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'wkcz';"
303
+ }
304
+ },
305
+ "ampsId": {
306
+ "type": "integer",
307
+ "title": "Amperage DP",
308
+ "placeholder": 8,
309
+ "condition": {
310
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cz' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'pc' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'wkcz';"
311
+ }
312
+ },
313
+ "wattsId": {
314
+ "type": "integer",
315
+ "title": "Power DP",
316
+ "placeholder": 7,
317
+ "condition": {
318
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cz' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'pc' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'wkcz';"
319
+ }
320
+ },
321
+ "voltsDivisor": {
322
+ "type": "integer",
323
+ "title": "Voltage Divisor",
324
+ "placeholder": 10,
325
+ "condition": {
326
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cz' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'pc' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'wkcz';"
327
+ }
328
+ },
329
+ "ampsDivisor": {
330
+ "type": "integer",
331
+ "title": "Amperage Divisor",
332
+ "placeholder": 1000,
333
+ "condition": {
334
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cz' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'pc' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'wkcz';"
335
+ }
336
+ },
337
+ "wattsDivisor": {
338
+ "type": "integer",
339
+ "title": "Power Divisor",
340
+ "placeholder": 10,
341
+ "condition": {
342
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cz' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'pc' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'wkcz';"
343
+ }
344
+ },
345
+ "noCool": {
346
+ "type": "boolean",
347
+ "title": "No Cool Mode",
348
+ "condition": {
349
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'kt' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'ktkzq';"
350
+ }
351
+ },
352
+ "noHeat": {
353
+ "type": "boolean",
354
+ "title": "No Heat Mode",
355
+ "condition": {
356
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'kt' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'ktkzq';"
357
+ }
358
+ },
359
+ "cmdCool": {
360
+ "type": "string",
361
+ "title": "Cool Command",
362
+ "placeholder": "COOL",
363
+ "condition": {
364
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'kt' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'ktkzq';"
365
+ }
366
+ },
367
+ "cmdHeat": {
368
+ "type": "string",
369
+ "title": "Heat Command",
370
+ "placeholder": "HEAT",
371
+ "condition": {
372
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'kt' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'ktkzq';"
373
+ }
374
+ },
375
+ "noSwing": {
376
+ "type": "boolean",
377
+ "title": "No Swing Mode",
378
+ "condition": {
379
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'kt' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'ktkzq';"
380
+ }
381
+ },
382
+ "minTemperature": {
383
+ "type": "integer",
384
+ "title": "Min Temperature",
385
+ "placeholder": 15,
386
+ "condition": {
387
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'kt' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'ktkzq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
388
+ }
389
+ },
390
+ "maxTemperature": {
391
+ "type": "integer",
392
+ "title": "Max Temperature",
393
+ "placeholder": 40,
394
+ "condition": {
395
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'kt' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'ktkzq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
396
+ }
397
+ },
398
+ "minTemperatureSteps": {
399
+ "type": "integer",
400
+ "title": "Min Temperature Steps",
401
+ "placeholder": 1,
402
+ "condition": {
403
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'kt' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'ktkzq';"
404
+ }
405
+ },
406
+ "dpActive": {
407
+ "type": "integer",
408
+ "title": "Active DP",
409
+ "placeholder": 7,
410
+ "condition": {
411
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'fs';"
412
+ }
413
+ },
414
+ "dpDesiredTemperature": {
415
+ "type": "integer",
416
+ "title": "Desired Temperature DP",
417
+ "placeholder": 2,
418
+ "condition": {
419
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
420
+ }
421
+ },
422
+ "dpCurrentTemperature": {
423
+ "type": "integer",
424
+ "title": "Current Temperature DP",
425
+ "placeholder": 3,
426
+ "condition": {
427
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
428
+ }
429
+ },
430
+ "dpAction": {
431
+ "type": "integer",
432
+ "title": "Action DP",
433
+ "placeholder": 1,
434
+ "condition": {
435
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'ckmkzq';"
436
+ }
437
+ },
438
+ "dpStatus": {
439
+ "type": "integer",
440
+ "title": "Status DP",
441
+ "placeholder": 2,
442
+ "condition": {
443
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'ckmkzq';"
444
+ }
445
+ },
446
+ "flipState": {
447
+ "type": "boolean",
448
+ "title": "Flip State",
449
+ "condition": {
450
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'ckmkzq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cl' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'clkg';"
451
+ }
452
+ },
453
+ "timeToOpen": {
454
+ "type": "integer",
455
+ "title": "Time to Open (seconds)",
456
+ "placeholder": 45,
457
+ "condition": {
458
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cl' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'clkg';"
459
+ }
460
+ },
461
+ "timeToTighten": {
462
+ "type": "integer",
463
+ "title": "Time to Tighten (seconds)",
464
+ "placeholder": 0,
465
+ "condition": {
466
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cl' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'clkg';"
467
+ }
468
+ },
469
+ "timeToClose": {
470
+ "type": "integer",
471
+ "title": "Time to Close (seconds)",
472
+ "placeholder": 30,
473
+ "description": "Time in seconds for blinds to fully open or close",
474
+ "condition": {
475
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cl' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'clkg';"
476
+ }
477
+ },
478
+ "dpLight": {
479
+ "type": "integer",
480
+ "title": "Light DP",
481
+ "placeholder": 1,
482
+ "condition": {
483
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cz' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'pc' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'wkcz';"
484
+ }
485
+ },
486
+ "dpBlindType": {
487
+ "type": "integer",
488
+ "title": "Blind Type DP",
489
+ "placeholder": 1,
490
+ "condition": {
491
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cl' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'clkg';"
492
+ }
493
+ },
494
+ "dpLightOn": {
495
+ "type": "integer",
496
+ "title": "Light On DP",
497
+ "placeholder": 9,
498
+ "condition": {
499
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'fs';"
500
+ }
501
+ },
502
+ "dpFanOn": {
503
+ "type": "integer",
504
+ "title": "Fan On DP",
505
+ "placeholder": 1,
506
+ "condition": {
507
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'fs';"
508
+ }
509
+ },
510
+ "dpRotationSpeed": {
511
+ "type": "integer",
512
+ "title": "Rotation Speed DP",
513
+ "placeholder": 4,
514
+ "condition": {
515
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'fs';"
516
+ }
517
+ },
518
+ "dpRotationDirection": {
519
+ "type": "integer",
520
+ "title": "Rotation Direction DP",
521
+ "placeholder": 63,
522
+ "condition": {
523
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'fs';"
524
+ }
525
+ },
526
+ "maxSpeed": {
527
+ "type": "integer",
528
+ "title": "Max Speed",
529
+ "placeholder": 3,
530
+ "condition": {
531
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'fs';"
532
+ }
533
+ },
534
+ "fanDefaultSpeed": {
535
+ "type": "integer",
536
+ "title": "Fan Default Speed",
537
+ "placeholder": 1,
538
+ "condition": {
539
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'fs';"
540
+ }
541
+ },
542
+ "useStrings": {
543
+ "type": "boolean",
544
+ "title": "Use Strings",
545
+ "placeholder": true,
546
+ "condition": {
547
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'fs';"
548
+ }
549
+ },
550
+ "dpChildLock": {
551
+ "type": "integer",
552
+ "title": "Child Lock DP",
553
+ "placeholder": 6,
554
+ "condition": {
555
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
556
+ }
557
+ },
558
+ "dpTemperatureDisplayUnits": {
559
+ "type": "integer",
560
+ "title": "Temperature Display Units DP",
561
+ "placeholder": 19,
562
+ "condition": {
563
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
564
+ }
565
+ },
566
+ "cmdLow": {
567
+ "type": "string",
568
+ "title": "Low Command",
569
+ "placeholder": "Low",
570
+ "condition": {
571
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
572
+ }
573
+ },
574
+ "cmdHigh": {
575
+ "type": "string",
576
+ "title": "High Command",
577
+ "placeholder": "High",
578
+ "condition": {
579
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
580
+ }
581
+ },
582
+ "noChildLock": {
583
+ "type": "boolean",
584
+ "title": "No Child Lock",
585
+ "condition": {
586
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
587
+ }
588
+ },
589
+ "noTemperatureUnit": {
590
+ "type": "boolean",
591
+ "title": "No Temperature Unit",
592
+ "condition": {
593
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
594
+ }
595
+ },
596
+ "temperatureDivisor": {
597
+ "type": "integer",
598
+ "title": "Temperature Divisor",
599
+ "placeholder": 1,
600
+ "condition": {
601
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
602
+ }
603
+ },
604
+ "thresholdTemperatureDivisor": {
605
+ "type": "integer",
606
+ "title": "Threshold Temperature Divisor",
607
+ "placeholder": 1,
608
+ "condition": {
609
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
610
+ }
611
+ },
612
+ "temperatureOffset": {
613
+ "type": "integer",
614
+ "title": "Temperature Offset",
615
+ "placeholder": 0,
616
+ "condition": {
617
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
618
+ }
619
+ }
620
+ }
621
+ }
622
+ }
623
+ }
624
+ },
16
625
  "options": {
17
- "title": "Project Info",
626
+ "title": "Cloud Account Info",
18
627
  "type": "object",
19
- "required": ["projectType", "accessId", "accessKey", "weatherAPI"],
628
+ "condition": {
629
+ "functionBody": "return (model.mode === 'cloud' || model.mode === 'both');"
630
+ },
20
631
  "properties": {
21
632
  "projectType": {
22
633
  "title": "Project Type (Development Method)",
634
+ "description": "Required for Cloud mode.",
23
635
  "type": "string",
24
636
  "default": "2",
637
+ "condition": {
638
+ "functionBody": "return (model.mode === 'cloud' || model.mode === 'both');"
639
+ },
25
640
  "oneOf": [
26
641
  {
27
642
  "title": "Custom",
@@ -40,26 +655,262 @@
40
655
  "endpoint": {
41
656
  "title": "Endpoint URL",
42
657
  "type": "string",
43
- "format": "url"
658
+ "format": "url",
659
+ "condition": {
660
+ "functionBody": "return (model.mode === 'cloud' || model.mode === 'both');"
661
+ }
44
662
  },
45
663
  "accessId": {
46
664
  "title": "Access ID",
47
- "type": "string"
665
+ "description": "Required for Cloud mode.",
666
+ "type": "string",
667
+ "condition": {
668
+ "functionBody": "return (model.mode === 'cloud' || model.mode === 'both');"
669
+ }
48
670
  },
49
671
  "accessKey": {
672
+ "description": "Required for Cloud mode.",
50
673
  "title": "Access Secret",
51
674
  "type": "string",
52
675
  "x-schema-form": {
53
676
  "type": "password"
677
+ },
678
+ "condition": {
679
+ "functionBody": "return (model.mode === 'cloud' || model.mode === 'both');"
54
680
  }
55
681
  },
56
682
  "countryCode": {
57
683
  "title": "Country Code",
684
+ "description": "Select your country or region",
58
685
  "type": "integer",
59
- "minimum": 1,
60
686
  "condition": {
61
687
  "functionBody": "return model.options.projectType === '2';"
62
- }
688
+ },
689
+ "anyOf": [
690
+ { "title": "United States", "enum": [1] },
691
+ { "title": "Canada", "enum": [1] },
692
+ { "title": "Russia", "enum": [7] },
693
+ { "title": "Egypt", "enum": [20] },
694
+ { "title": "South Africa", "enum": [27] },
695
+ { "title": "Greece", "enum": [30] },
696
+ { "title": "Netherlands", "enum": [31] },
697
+ { "title": "Belgium", "enum": [32] },
698
+ { "title": "France", "enum": [33] },
699
+ { "title": "Spain", "enum": [34] },
700
+ { "title": "Hungary", "enum": [36] },
701
+ { "title": "Italy", "enum": [39] },
702
+ { "title": "Romania", "enum": [40] },
703
+ { "title": "Switzerland", "enum": [41] },
704
+ { "title": "Austria", "enum": [43] },
705
+ { "title": "United Kingdom", "enum": [44] },
706
+ { "title": "Denmark", "enum": [45] },
707
+ { "title": "Sweden", "enum": [46] },
708
+ { "title": "Norway", "enum": [47] },
709
+ { "title": "Poland", "enum": [48] },
710
+ { "title": "Germany", "enum": [49] },
711
+ { "title": "Peru", "enum": [51] },
712
+ { "title": "Mexico", "enum": [52] },
713
+ { "title": "Argentina", "enum": [54] },
714
+ { "title": "Brazil", "enum": [55] },
715
+ { "title": "Chile", "enum": [56] },
716
+ { "title": "Colombia", "enum": [57] },
717
+ { "title": "Venezuela", "enum": [58] },
718
+ { "title": "Malaysia", "enum": [60] },
719
+ { "title": "Australia", "enum": [61] },
720
+ { "title": "Indonesia", "enum": [62] },
721
+ { "title": "Philippines", "enum": [63] },
722
+ { "title": "New Zealand", "enum": [64] },
723
+ { "title": "Singapore", "enum": [65] },
724
+ { "title": "Thailand", "enum": [66] },
725
+ { "title": "Japan", "enum": [81] },
726
+ { "title": "South Korea", "enum": [82] },
727
+ { "title": "Vietnam", "enum": [84] },
728
+ { "title": "China", "enum": [86] },
729
+ { "title": "Turkey", "enum": [90] },
730
+ { "title": "India", "enum": [91] },
731
+ { "title": "Pakistan", "enum": [92] },
732
+ { "title": "Afghanistan", "enum": [93] },
733
+ { "title": "Sri Lanka", "enum": [94] },
734
+ { "title": "Myanmar", "enum": [95] },
735
+ { "title": "Morocco", "enum": [212] },
736
+ { "title": "Algeria", "enum": [213] },
737
+ { "title": "Tunisia", "enum": [216] },
738
+ { "title": "Libya", "enum": [218] },
739
+ { "title": "The Gambia", "enum": [220] },
740
+ { "title": "Senegal", "enum": [221] },
741
+ { "title": "Mauritania", "enum": [222] },
742
+ { "title": "Mali", "enum": [223] },
743
+ { "title": "Guinea", "enum": [224] },
744
+ { "title": "Côte d'Ivoire", "enum": [225] },
745
+ { "title": "Burkina Faso", "enum": [226] },
746
+ { "title": "Niger", "enum": [227] },
747
+ { "title": "Togo", "enum": [228] },
748
+ { "title": "Benin", "enum": [229] },
749
+ { "title": "Mauritius", "enum": [230] },
750
+ { "title": "Liberia", "enum": [231] },
751
+ { "title": "Sierra Leone", "enum": [232] },
752
+ { "title": "Ghana", "enum": [233] },
753
+ { "title": "Nigeria", "enum": [234] },
754
+ { "title": "Chad", "enum": [235] },
755
+ { "title": "Central African Republic", "enum": [236] },
756
+ { "title": "Cameroon", "enum": [237] },
757
+ { "title": "Cabo Verde", "enum": [238] },
758
+ { "title": "São Tomé and Príncipe", "enum": [239] },
759
+ { "title": "Equatorial Guinea", "enum": [240] },
760
+ { "title": "Gabon", "enum": [241] },
761
+ { "title": "Congo", "enum": [242] },
762
+ { "title": "Congo (DRC)", "enum": [243] },
763
+ { "title": "Angola", "enum": [244] },
764
+ { "title": "Guinea-Bissau", "enum": [245] },
765
+ { "title": "British Indian Ocean Territory", "enum": [246] },
766
+ { "title": "Seychelles", "enum": [248] },
767
+ { "title": "Rwanda", "enum": [250] },
768
+ { "title": "Ethiopia", "enum": [251] },
769
+ { "title": "Somalia", "enum": [252] },
770
+ { "title": "Djibouti", "enum": [253] },
771
+ { "title": "Kenya", "enum": [254] },
772
+ { "title": "Tanzania", "enum": [255] },
773
+ { "title": "Uganda", "enum": [256] },
774
+ { "title": "Burundi", "enum": [257] },
775
+ { "title": "Mozambique", "enum": [258] },
776
+ { "title": "Zambia", "enum": [260] },
777
+ { "title": "Madagascar", "enum": [261] },
778
+ { "title": "Mayotte", "enum": [262] },
779
+ { "title": "Zimbabwe", "enum": [263] },
780
+ { "title": "Namibia", "enum": [264] },
781
+ { "title": "Malawi", "enum": [265] },
782
+ { "title": "Lesotho", "enum": [266] },
783
+ { "title": "Botswana", "enum": [267] },
784
+ { "title": "Swaziland", "enum": [268] },
785
+ { "title": "Comoros", "enum": [269] },
786
+ { "title": "Eritrea", "enum": [291] },
787
+ { "title": "Aruba", "enum": [297] },
788
+ { "title": "Faroe Islands", "enum": [298] },
789
+ { "title": "Greenland", "enum": [299] },
790
+ { "title": "Gibraltar", "enum": [350] },
791
+ { "title": "Portugal", "enum": [351] },
792
+ { "title": "Luxembourg", "enum": [352] },
793
+ { "title": "Ireland", "enum": [353] },
794
+ { "title": "Iceland", "enum": [354] },
795
+ { "title": "Albania", "enum": [355] },
796
+ { "title": "Malta", "enum": [356] },
797
+ { "title": "Cyprus", "enum": [357] },
798
+ { "title": "Finland", "enum": [358] },
799
+ { "title": "Bulgaria", "enum": [359] },
800
+ { "title": "Lithuania", "enum": [370] },
801
+ { "title": "Latvia", "enum": [371] },
802
+ { "title": "Estonia", "enum": [372] },
803
+ { "title": "Moldova", "enum": [373] },
804
+ { "title": "Armenia", "enum": [374] },
805
+ { "title": "Belarus", "enum": [375] },
806
+ { "title": "Andorra", "enum": [376] },
807
+ { "title": "Monaco", "enum": [377] },
808
+ { "title": "San Marino", "enum": [378] },
809
+ { "title": "Vatican City", "enum": [379] },
810
+ { "title": "Ukraine", "enum": [380] },
811
+ { "title": "Serbia", "enum": [381] },
812
+ { "title": "Montenegro", "enum": [382] },
813
+ { "title": "Croatia", "enum": [385] },
814
+ { "title": "Slovenia", "enum": [386] },
815
+ { "title": "Bosnia and Herzegovina", "enum": [387] },
816
+ { "title": "Macedonian", "enum": [389] },
817
+ { "title": "Czech Republic", "enum": [420] },
818
+ { "title": "Slovakia", "enum": [421] },
819
+ { "title": "Liechtenstein", "enum": [423] },
820
+ { "title": "Belize", "enum": [501] },
821
+ { "title": "Guatemala", "enum": [502] },
822
+ { "title": "El Salvador", "enum": [503] },
823
+ { "title": "Honduras", "enum": [504] },
824
+ { "title": "Nicaragua", "enum": [505] },
825
+ { "title": "Costa Rica", "enum": [506] },
826
+ { "title": "Panama", "enum": [507] },
827
+ { "title": "Saint Pierre and Miquelon", "enum": [508] },
828
+ { "title": "Haiti", "enum": [509] },
829
+ { "title": "Saint Martin", "enum": [590] },
830
+ { "title": "Bolivia", "enum": [591] },
831
+ { "title": "Guyana", "enum": [592] },
832
+ { "title": "Ecuador", "enum": [593] },
833
+ { "title": "French Guiana", "enum": [594] },
834
+ { "title": "Paraguay", "enum": [595] },
835
+ { "title": "Martinique", "enum": [596] },
836
+ { "title": "Suriname", "enum": [597] },
837
+ { "title": "Uruguay", "enum": [598] },
838
+ { "title": "Brunei", "enum": [673] },
839
+ { "title": "Nauru", "enum": [674] },
840
+ { "title": "Papua New Guinea", "enum": [675] },
841
+ { "title": "Tonga", "enum": [676] },
842
+ { "title": "Solomon Islands", "enum": [677] },
843
+ { "title": "Vanuatu", "enum": [678] },
844
+ { "title": "Fiji", "enum": [679] },
845
+ { "title": "Palau", "enum": [680] },
846
+ { "title": "Wallis and Futuna", "enum": [681] },
847
+ { "title": "Cook Islands", "enum": [682] },
848
+ { "title": "Niue", "enum": [683] },
849
+ { "title": "Samoa", "enum": [685] },
850
+ { "title": "Kiribati", "enum": [686] },
851
+ { "title": "New Caledonia", "enum": [687] },
852
+ { "title": "Tuvalu", "enum": [688] },
853
+ { "title": "French Polynesia", "enum": [689] },
854
+ { "title": "Tokelau", "enum": [690] },
855
+ { "title": "Federated States of Micronesia", "enum": [691] },
856
+ { "title": "Marshall Islands", "enum": [692] },
857
+ { "title": "Cambodia", "enum": [855] },
858
+ { "title": "Laos", "enum": [856] },
859
+ { "title": "Hong Kong", "enum": [852] },
860
+ { "title": "Macao", "enum": [853] },
861
+ { "title": "Taiwan", "enum": [886] },
862
+ { "title": "Bangladesh", "enum": [880] },
863
+ { "title": "Maldives", "enum": [960] },
864
+ { "title": "Lebanon", "enum": [961] },
865
+ { "title": "Jordan", "enum": [962] },
866
+ { "title": "Iraq", "enum": [964] },
867
+ { "title": "Kuwait", "enum": [965] },
868
+ { "title": "Saudi Arabia", "enum": [966] },
869
+ { "title": "Yemen", "enum": [967] },
870
+ { "title": "Oman", "enum": [968] },
871
+ { "title": "Palestine", "enum": [970] },
872
+ { "title": "United Arab Emirates", "enum": [971] },
873
+ { "title": "Israel", "enum": [972] },
874
+ { "title": "Bahrain", "enum": [973] },
875
+ { "title": "Qatar", "enum": [974] },
876
+ { "title": "Bhutan", "enum": [975] },
877
+ { "title": "Mongolia", "enum": [976] },
878
+ { "title": "Nepal", "enum": [977] },
879
+ { "title": "Tajikistan", "enum": [992] },
880
+ { "title": "Turkmenistan", "enum": [993] },
881
+ { "title": "Azerbaijan", "enum": [994] },
882
+ { "title": "Georgia", "enum": [995] },
883
+ { "title": "Kyrgyzstan", "enum": [996] },
884
+ { "title": "Uzbekistan", "enum": [998] },
885
+ { "title": "Bahamas", "enum": [1242] },
886
+ { "title": "Barbados", "enum": [1246] },
887
+ { "title": "Anguilla", "enum": [1264] },
888
+ { "title": "Antigua and Barbuda", "enum": [1268] },
889
+ { "title": "British Virgin Islands", "enum": [1284] },
890
+ { "title": "U.S. Virgin Islands", "enum": [1340] },
891
+ { "title": "Cayman Islands", "enum": [1345] },
892
+ { "title": "Bermuda", "enum": [1441] },
893
+ { "title": "Grenada", "enum": [1473] },
894
+ { "title": "Turks and Caicos Islands", "enum": [1649] },
895
+ { "title": "Montserrat", "enum": [1664] },
896
+ { "title": "Northern Mariana Islands", "enum": [1670] },
897
+ { "title": "Guam", "enum": [1671] },
898
+ { "title": "American Samoa", "enum": [1684] },
899
+ { "title": "Sint Maarten", "enum": [1721] },
900
+ { "title": "Saint Lucia", "enum": [1758] },
901
+ { "title": "Dominica", "enum": [1767] },
902
+ { "title": "Saint Vincent and the Grenadines", "enum": [1784] },
903
+ { "title": "Puerto Rico", "enum": [1787] },
904
+ { "title": "Dominican Republic (809)", "enum": [1809] },
905
+ { "title": "Dominican Republic (829)", "enum": [1829] },
906
+ { "title": "Dominican Republic (849)", "enum": [1849] },
907
+ { "title": "Trinidad and Tobago", "enum": [1868] },
908
+ { "title": "Saint Kitts and Nevis", "enum": [1869] },
909
+ { "title": "Jamaica", "enum": [1876] },
910
+ { "title": "Svalbard and Jan Mayen", "enum": [4779] },
911
+ { "title": "Curaçao", "enum": [5999] },
912
+ { "title": "Åland Islands", "enum": [35818] }
913
+ ]
63
914
  },
64
915
  "username": {
65
916
  "title": "Username",
@@ -115,6 +966,9 @@
115
966
  "deviceOverrides": {
116
967
  "title": "Device Overriding Configs",
117
968
  "type": "array",
969
+ "condition": {
970
+ "functionBody": "return (model.mode === 'cloud' || model.mode === 'both');"
971
+ },
118
972
  "items": {
119
973
  "type": "object",
120
974
  "required": ["id"],
@@ -275,6 +1129,9 @@
275
1129
  "title": "Accessory Service Informations ",
276
1130
  "description": "Accessory Service Information Configs",
277
1131
  "type": "array",
1132
+ "condition": {
1133
+ "functionBody": "return (model.mode === 'cloud' || model.mode === 'both');"
1134
+ },
278
1135
  "items": {
279
1136
  "type": "object",
280
1137
  "required": ["device_id", "index"],
@@ -344,15 +1201,109 @@
344
1201
  }
345
1202
  }
346
1203
  }
347
- },
348
- "required":["name"]
1204
+ }
349
1205
  },
350
1206
  "layout": [
1207
+ "mode",
351
1208
  {
352
1209
  "type": "fieldset",
353
- "title": "Tuya Account Info",
1210
+ "title": "Local Settings",
1211
+ "expandable": true,
1212
+ "expanded": true,
1213
+ "condition": {
1214
+ "functionBody": "return (model.mode === 'local' || model.mode === 'both');"
1215
+ },
1216
+ "items": [
1217
+ "local.autoDiscoverDevices",
1218
+ "local.discoverTimeout",
1219
+ "local.rediscoverInterval",
1220
+ {
1221
+ "key": "local.devices",
1222
+ "add": "Add Manual Device",
1223
+ "title": "{{ 'Add New Device' }}",
1224
+ "type": "tabarray",
1225
+ "notitle": true,
1226
+ "items": [
1227
+ {
1228
+ "type": "div",
1229
+ "displayFlex": false,
1230
+ "notitle": true,
1231
+ "title": "{{ value.name || value.tuyaDeviceId || 'New Device' }}",
1232
+ "items": [
1233
+ { "key": "local.devices[].category" },
1234
+ { "key": "local.devices[].name" },
1235
+ { "key": "local.devices[].tuyaDeviceId" },
1236
+ { "key": "local.devices[].tuyaKey" },
1237
+ { "key": "local.devices[].ip" },
1238
+ { "key": "local.devices[].protocolVersion" },
1239
+ { "key": "local.devices[].dpMapping" },
1240
+ { "key": "local.devices[].outletCount" },
1241
+ { "key": "local.devices[].outlets" },
1242
+ { "key": "local.devices[].dpPower" },
1243
+ { "key": "local.devices[].dpBrightness" },
1244
+ { "key": "local.devices[].dpColorTemperature" },
1245
+ { "key": "local.devices[].minWhiteColor" },
1246
+ { "key": "local.devices[].maxWhiteColor" },
1247
+ { "key": "local.devices[].dpMode" },
1248
+ { "key": "local.devices[].dpColor" },
1249
+ { "key": "local.devices[].colorFunction" },
1250
+ { "key": "local.devices[].scaleBrightness" },
1251
+ { "key": "local.devices[].scaleWhiteColor" },
1252
+ { "key": "local.devices[].voltsId" },
1253
+ { "key": "local.devices[].ampsId" },
1254
+ { "key": "local.devices[].wattsId" },
1255
+ { "key": "local.devices[].voltsDivisor" },
1256
+ { "key": "local.devices[].ampsDivisor" },
1257
+ { "key": "local.devices[].wattsDivisor" },
1258
+ { "key": "local.devices[].noCool" },
1259
+ { "key": "local.devices[].noHeat" },
1260
+ { "key": "local.devices[].cmdCool" },
1261
+ { "key": "local.devices[].cmdHeat" },
1262
+ { "key": "local.devices[].noSwing" },
1263
+ { "key": "local.devices[].minTemperature" },
1264
+ { "key": "local.devices[].maxTemperature" },
1265
+ { "key": "local.devices[].minTemperatureSteps" },
1266
+ { "key": "local.devices[].dpActive" },
1267
+ { "key": "local.devices[].dpDesiredTemperature" },
1268
+ { "key": "local.devices[].dpCurrentTemperature" },
1269
+ { "key": "local.devices[].dpAction" },
1270
+ { "key": "local.devices[].dpStatus" },
1271
+ { "key": "local.devices[].flipState" },
1272
+ { "key": "local.devices[].timeToOpen" },
1273
+ { "key": "local.devices[].timeToTighten" },
1274
+ { "key": "local.devices[].timeToClose" },
1275
+ { "key": "local.devices[].dpLight" },
1276
+ { "key": "local.devices[].dpBlindType" },
1277
+ { "key": "local.devices[].dpLightOn" },
1278
+ { "key": "local.devices[].dpFanOn" },
1279
+ { "key": "local.devices[].dpRotationSpeed" },
1280
+ { "key": "local.devices[].dpRotationDirection" },
1281
+ { "key": "local.devices[].maxSpeed" },
1282
+ { "key": "local.devices[].fanDefaultSpeed" },
1283
+ { "key": "local.devices[].useStrings" },
1284
+ { "key": "local.devices[].dpChildLock" },
1285
+ { "key": "local.devices[].dpTemperatureDisplayUnits" },
1286
+ { "key": "local.devices[].cmdLow" },
1287
+ { "key": "local.devices[].cmdHigh" },
1288
+ { "key": "local.devices[].noChildLock" },
1289
+ { "key": "local.devices[].noTemperatureUnit" },
1290
+ { "key": "local.devices[].temperatureDivisor" },
1291
+ { "key": "local.devices[].thresholdTemperatureDivisor" },
1292
+ { "key": "local.devices[].temperatureOffset" }
1293
+ ]
1294
+ }
1295
+ ]
1296
+ }
1297
+ ]
1298
+ },
1299
+ {
1300
+ "type": "fieldset",
1301
+ "title": "Tuya Cloud Account Info",
354
1302
  "expandable": true,
355
1303
  "expanded": false,
1304
+ "condition": {
1305
+ "functionBody": "return (model.mode === 'cloud' || model.mode === 'both');"
1306
+ },
356
1307
  "items": [
357
1308
  "options.projectType",
358
1309
  "options.endpoint",
@@ -370,6 +1321,9 @@
370
1321
  "expandable": true,
371
1322
  "expanded": false,
372
1323
  "notitle": false,
1324
+ "condition": {
1325
+ "functionBody": "return (model.mode === 'cloud' || model.mode === 'both');"
1326
+ },
373
1327
  "items": [
374
1328
  {
375
1329
  "key": "options.homeWhitelist",
@@ -401,6 +1355,9 @@
401
1355
  "expandable": true,
402
1356
  "expanded": true,
403
1357
  "notitle": false,
1358
+ "condition": {
1359
+ "functionBody": "return (model.mode === 'cloud' || model.mode === 'both');"
1360
+ },
404
1361
  "items": [
405
1362
  {
406
1363
  "key": "options.deviceOverrides",
@@ -408,13 +1365,14 @@
408
1365
  "title": "{{ 'New Device Override' }}",
409
1366
  "type": "tabarray",
410
1367
  "notitle": true,
1368
+ "default": [],
411
1369
  "items": [
412
1370
  {
413
1371
  "type": "div",
414
1372
  "displayFlex": false,
415
1373
  "flex-direction": "row",
416
1374
  "notitle": true,
417
- "title": "{{ value.id }}",
1375
+ "title": "{{ value.id || 'New Device Override' }}",
418
1376
  "items": [
419
1377
  {
420
1378
  "key": "options.deviceOverrides[].id"
@@ -500,6 +1458,9 @@
500
1458
  "expandable": true,
501
1459
  "expanded": false,
502
1460
  "notitle": false,
1461
+ "condition": {
1462
+ "functionBody": "return (model.mode === 'cloud' || model.mode === 'both');"
1463
+ },
503
1464
  "items": [
504
1465
  {
505
1466
  "key": "options.serviceInformationOverrides",
@@ -507,6 +1468,7 @@
507
1468
  "title": "{{ 'New Service Information Override' }}",
508
1469
  "type": "tabarray",
509
1470
  "notitle": true,
1471
+ "default": [],
510
1472
  "items": [
511
1473
  {
512
1474
  "type": "div",
@@ -545,6 +1507,9 @@
545
1507
  "expandable": true,
546
1508
  "expanded": false,
547
1509
  "notitle": false,
1510
+ "condition": {
1511
+ "functionBody": "return (model.mode === 'cloud' || model.mode === 'both');"
1512
+ },
548
1513
  "items": [
549
1514
  "options.generateWeatherAccessory",
550
1515
  "options.weatherAPI",