中控升级 v1.3.0 版本后设备别名/设备名为纯数字时发现排序乱了,可以运行在中控使用快速运行运行以下代码:
勾选设备->点击「快速运行」按钮->复制代码->点击「运行」运行成功后,点击「重连」后排序即可显示正常。
修改设备别名:
|
1 2 3 4 5 6 7 8 |
require("TSLib") local deviceAlias = getDeviceAlias() if string.len(deviceAlias) <= 3 and string.find(deviceAlias, "^[+-]?%d+$") then --会在设备别名前加 0000,然后取后 4 位数字 setDeviceAlias(string.sub("0000" .. deviceAlias,-4)) --如果需要设别名为 5 位,代码如下: --setDeviceAlias(string.sub("00000" .. deviceAlias,-5)) end |
修改设备名:
|
1 2 3 4 5 |
require("TSLib") local deviceAlias = getDeviceName() if string.len(deviceAlias) <= 3 and string.find(deviceAlias, "^[+-]?%d+$") then setDeviceName(string.sub("0000" .. deviceAlias,-4)) end |
操作视频