mirror of
https://github.com/ct-Open-Source/tuya-convert.git
synced 2026-03-02 14:44:12 +01:00
Cut hostapd.conf down to bare configuration Added hostapd ctrl interface Reduce log noise by specifying hostapd log level info Specify interface for hostapd by argument rather than config No password on vtrust-flash Updated smartconfig for no password
37 lines
818 B
Python
Executable File
37 lines
818 B
Python
Executable File
#!/usr/bin/env python3
|
|
# encoding: utf-8
|
|
"""
|
|
main.py
|
|
Created by kueblc on 2019-01-25.
|
|
Configure Tuya devices via smartconfig for tuya-convert
|
|
"""
|
|
|
|
ssid = "vtrust-flash"
|
|
passwd = ""
|
|
region = "US"
|
|
token = "00000000"
|
|
secret = "0101"
|
|
|
|
from smartconfig import smartconfig
|
|
from time import sleep
|
|
|
|
print('Put device in EZ config mode (blinking fast)')
|
|
print('Sending SSID '+ssid)
|
|
print('Sending wifiPassword '+passwd)
|
|
print('Sending token '+token)
|
|
print('Sending secret '+secret)
|
|
|
|
for i in range(10): # Make 10 attempts
|
|
|
|
smartconfig( passwd, ssid, region, token, secret )
|
|
|
|
print()
|
|
print('SmartConfig complete.')
|
|
|
|
for t in range(3, 0, -1):
|
|
print('Auto retry in %ds. ' % t, end='', flush=True)
|
|
sleep(1)
|
|
print(end='\r')
|
|
|
|
print('Resending SmartConfig Packets')
|