@ray-js/api 1.6.29 → 1.6.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md ADDED
@@ -0,0 +1,9 @@
1
+ Copyright © 2014-2022 Tuya.inc
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -104,4 +104,15 @@ type GetLightHighPowerResponse = {
104
104
  * @returns
105
105
  */
106
106
  declare const getLightHighPower: (params: GetLightHighPowerParams) => Promise<GetLightHighPowerResponse>;
107
- export { getDpsInfos, updateDpName, getGroupDpsInfos, updateGroupDpName, getWeatherQuality, getWeathers, saveCustomizePosition, getCustomizePosition, getDevProperty, saveDevProperty, getRemoteLocalRelation, getLightHighPower, };
107
+ /**
108
+ * 设置设备地址
109
+ * @param devId 设备id
110
+ * @param address 设备地址
111
+ */
112
+ declare const setDeviceAddress: (devId: string, address: string) => void;
113
+ /**
114
+ * 获取设备地址
115
+ * @param devId 设备id
116
+ */
117
+ declare const getDeviceAddress: (devId: string, propertyKey: string) => void;
118
+ export { getDpsInfos, updateDpName, getGroupDpsInfos, updateGroupDpName, getWeatherQuality, getWeathers, saveCustomizePosition, getCustomizePosition, getDevProperty, saveDevProperty, getRemoteLocalRelation, getLightHighPower, setDeviceAddress, getDeviceAddress, };
@@ -165,4 +165,35 @@ const getLightHighPower = params => {
165
165
  version: '1.2'
166
166
  });
167
167
  };
168
- export { getDpsInfos, updateDpName, getGroupDpsInfos, updateGroupDpName, getWeatherQuality, getWeathers, saveCustomizePosition, getCustomizePosition, getDevProperty, saveDevProperty, getRemoteLocalRelation, getLightHighPower };
168
+
169
+ /**
170
+ * 设置设备地址
171
+ * @param devId 设备id
172
+ * @param address 设备地址
173
+ */
174
+ const setDeviceAddress = (devId, address) => requestCloud({
175
+ api: 'm.energy.device.properties.extend.add',
176
+ data: {
177
+ device_id: devId,
178
+ properties: JSON.stringify({
179
+ address
180
+ })
181
+ },
182
+ version: '1.0'
183
+ });
184
+
185
+ /**
186
+ * 获取设备地址
187
+ * @param devId 设备id
188
+ */
189
+ const getDeviceAddress = (devId, propertyKey) => {
190
+ return requestCloud({
191
+ api: 'm.energy.device.properties.extend.get',
192
+ data: {
193
+ device_id: devId,
194
+ property_key: propertyKey
195
+ },
196
+ version: '1.0'
197
+ });
198
+ };
199
+ export { getDpsInfos, updateDpName, getGroupDpsInfos, updateGroupDpName, getWeatherQuality, getWeathers, saveCustomizePosition, getCustomizePosition, getDevProperty, saveDevProperty, getRemoteLocalRelation, getLightHighPower, setDeviceAddress, getDeviceAddress };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/api",
3
- "version": "1.6.29",
3
+ "version": "1.6.30",
4
4
  "description": "Ray universal api",
5
5
  "keywords": [
6
6
  "ray"
@@ -29,14 +29,14 @@
29
29
  "watch": "ray start --type=component"
30
30
  },
31
31
  "dependencies": {
32
- "@ray-js/framework": "1.6.29",
33
- "@ray-js/router": "1.6.29",
32
+ "@ray-js/framework": "1.6.30",
33
+ "@ray-js/router": "1.6.30",
34
34
  "@ray-js/wechat": "^0.3.8",
35
35
  "base64-browser": "^1.0.1",
36
36
  "query-string": "^7.1.3"
37
37
  },
38
38
  "devDependencies": {
39
- "@ray-js/cli": "1.6.29",
39
+ "@ray-js/cli": "1.6.30",
40
40
  "art-template": "^4.13.4",
41
41
  "fs-extra": "^10.1.0",
42
42
  "miniprogram-api-typings": "^3.12.3",
@@ -46,5 +46,5 @@
46
46
  "access": "public",
47
47
  "registry": "https://registry.npmjs.com"
48
48
  },
49
- "gitHead": "511cd3f8d57c2888411700526781e65959037c5b"
49
+ "gitHead": "6db627db6ff0dffe0a249fbfc07b0281454e82c9"
50
50
  }