diff --git a/ap_preambles.txt b/ap_preambles.txt index 9a8f0c0..3d6bf66 100644 --- a/ap_preambles.txt +++ b/ap_preambles.txt @@ -13,3 +13,4 @@ GRID- TreatLife-SL- SL-CreeLighting- LDV SMART+- +SL-FLSNT- diff --git a/common.sh b/common.sh index 874a82e..7570100 100644 --- a/common.sh +++ b/common.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -COMBINED_AP_PREAMBLE=$(cat ap_preambles.txt | grep -v '#' | awk '{print "-e \""$0"\"" }' | tr '\n' ' ') +COMBINED_AP_PREAMBLE=$(cat ap_preambles.txt | grep -v '#' | sort -u | awk '{print "-e \""$0"\"" }' | tr '\n' ' ') AP_MATCHED_NAME="" FIRST_WIFI=$(nmcli device status | grep " wifi " | head -n1 | awk -F ' ' '{print $1}') @@ -15,7 +15,7 @@ if [ -z ${RESETNM+x} ]; then return 0 else echo "Wiping NetworkManager configs" - rm /etc/NetworkManager/system-connections/*.nmconnection* + rm -f /etc/NetworkManager/system-connections/*.nmconnection* service NetworkManager restart return 0 fi @@ -24,8 +24,8 @@ fi wifi_connect () { AP_PASS=${1:-""} - - AP_SEARCH_LIST=$(echo ${COMBINED_AP_PREAMBLE} | sed 's/-e / /g') + + AP_SEARCH_LIST=$(echo ${COMBINED_AP_PREAMBLE} | sed 's/-e //g') for i in {1..5} do diff --git a/device-profiles/FLSNT/BR30-RGBWCT/atop.online.debug.log.json b/device-profiles/FLSNT/BR30-RGBWCT/atop.online.debug.log.json new file mode 100644 index 0000000..84b1695 --- /dev/null +++ b/device-profiles/FLSNT/BR30-RGBWCT/atop.online.debug.log.json @@ -0,0 +1 @@ +{"result": true, "t": 1644810584, "success": true} \ No newline at end of file diff --git a/device-profiles/FLSNT/BR30-RGBWCT/profile b/device-profiles/FLSNT/BR30-RGBWCT/profile new file mode 100644 index 0000000..eca0639 --- /dev/null +++ b/device-profiles/FLSNT/BR30-RGBWCT/profile @@ -0,0 +1,7 @@ +{ + "chip": "BK7231T", + "payload": "eyJhdXprZXkiOiJBVVRIS0VZQUFBQUFBQUFBIiwidXVpZCI6IlVVSURBQUFBQUFBQSIsInBza0tleSI6IiIsInByb2RfdGVzdCI6ZmFsc2UsImFwX3NzaWQiOiJBIiwic3NpZCI6IkEiLCJ0b2tlbiI6IkFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQfHBCiJ9", + "authkey_template": "AUTHKEYAAAAAAAAA", + "uuid_template": "UUIDAAAAAAAA", + "datagram_padding": "QkJCQpHwCQCR8AkAkfAJAJHwCQCR8AkAkfAJAJHwCQCR8AkAkfAJAA==" +} \ No newline at end of file diff --git a/device-profiles/FLSNT/BR30-RGBWCT/tuya.device.active.json b/device-profiles/FLSNT/BR30-RGBWCT/tuya.device.active.json new file mode 100644 index 0000000..84d0ccb --- /dev/null +++ b/device-profiles/FLSNT/BR30-RGBWCT/tuya.device.active.json @@ -0,0 +1 @@ +{"result": {"schema": "[{\"type\":\"obj\",\"mode\":\"rw\",\"property\":{\"type\":\"bool\"},\"id\":20},{\"type\":\"obj\",\"mode\":\"rw\",\"property\":{\"range\":[\"white\",\"colour\",\"scene\",\"music\"],\"type\":\"enum\"},\"id\":21},{\"type\":\"obj\",\"mode\":\"rw\",\"property\":{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1,\"type\":\"value\"},\"id\":22},{\"type\":\"obj\",\"mode\":\"rw\",\"property\":{\"min\":0,\"max\":1000,\"scale\":0,\"step\":1,\"type\":\"value\"},\"id\":23},{\"type\":\"obj\",\"mode\":\"rw\",\"property\":{\"type\":\"string\",\"maxlen\":255},\"id\":24},{\"type\":\"obj\",\"mode\":\"rw\",\"property\":{\"type\":\"string\",\"maxlen\":255},\"id\":25},{\"type\":\"obj\",\"mode\":\"rw\",\"property\":{\"min\":0,\"max\":86400,\"scale\":0,\"step\":1,\"type\":\"value\"},\"id\":26},{\"type\":\"obj\",\"mode\":\"wr\",\"property\":{\"type\":\"string\",\"maxlen\":255},\"id\":28}]", "devId": "eb8253eda82dc2ddbanouq", "resetFactory": false, "timeZone": "+01:00", "capability": 1025, "secKey": "f46e817cd6bf0985", "stdTimeZone": "+01:00", "schemaId": "0000021mld", "dstIntervals": [[1648342800, 1667091600], [1679792400, 1698541200], [1711846800, 1729990800], [1743296400, 1761440400], [1774746000, 1792890000]], "localKey": "1b20a974a8ea7569"}, "t": 1644810572, "success": true} \ No newline at end of file diff --git a/device-profiles/FLSNT/BR30-RGBWCT/tuya.device.dynamic.config.ack.json b/device-profiles/FLSNT/BR30-RGBWCT/tuya.device.dynamic.config.ack.json new file mode 100644 index 0000000..42bce17 --- /dev/null +++ b/device-profiles/FLSNT/BR30-RGBWCT/tuya.device.dynamic.config.ack.json @@ -0,0 +1 @@ +{"t": 1644810586, "success": true} \ No newline at end of file diff --git a/device-profiles/FLSNT/BR30-RGBWCT/tuya.device.dynamic.config.get.json b/device-profiles/FLSNT/BR30-RGBWCT/tuya.device.dynamic.config.get.json new file mode 100644 index 0000000..0350ca6 --- /dev/null +++ b/device-profiles/FLSNT/BR30-RGBWCT/tuya.device.dynamic.config.get.json @@ -0,0 +1 @@ +{"result": {"ackId": "0-0", "validTime": 1800, "time": 1644810585, "config": {"stdTimeZone": "+01:00", "dstIntervals": [[1648342800, 1667091600], [1679792400, 1698541200]]}}, "t": 1644810585, "success": true} \ No newline at end of file diff --git a/device-profiles/FLSNT/BR30-RGBWCT/tuya.device.timer.count.json b/device-profiles/FLSNT/BR30-RGBWCT/tuya.device.timer.count.json new file mode 100644 index 0000000..e0271a5 --- /dev/null +++ b/device-profiles/FLSNT/BR30-RGBWCT/tuya.device.timer.count.json @@ -0,0 +1 @@ +{"result": {"devId": "bf8d34cb20a1497360ivjw", "count": 0, "lastFetchTime": 0}, "t": 1644810591, "success": true} \ No newline at end of file diff --git a/device-profiles/FLSNT/BR30-RGBWCT/tuya.device.upgrade.silent.get.json b/device-profiles/FLSNT/BR30-RGBWCT/tuya.device.upgrade.silent.get.json new file mode 100644 index 0000000..4b531c7 --- /dev/null +++ b/device-profiles/FLSNT/BR30-RGBWCT/tuya.device.upgrade.silent.get.json @@ -0,0 +1 @@ +{"t": 1644810589, "success": true} \ No newline at end of file diff --git a/device-profiles/FLSNT/BR30-RGBWCT/tuya.device.uuid.pskkey.get.json b/device-profiles/FLSNT/BR30-RGBWCT/tuya.device.uuid.pskkey.get.json new file mode 100644 index 0000000..b687d0e --- /dev/null +++ b/device-profiles/FLSNT/BR30-RGBWCT/tuya.device.uuid.pskkey.get.json @@ -0,0 +1 @@ +{"result": {"pskKey": "NA"}, "t": 1644810473, "success": true} \ No newline at end of file diff --git a/src/get_input.py b/src/get_input.py index 63e5b0e..952f183 100644 --- a/src/get_input.py +++ b/src/get_input.py @@ -8,7 +8,7 @@ def ask_options(text, options): def ask_files(text, dir): files = [path for path in os.listdir(dir) if not path.startswith(".")] - return ask_options(text, files)['result'] + return ask_options(text, sorted(files, key=str.casefold))['result'] def ask_device_type():