v.0.8.0 DEV CONTAINER
This commit is contained in:
@@ -1,20 +1,22 @@
|
||||
import time
|
||||
import network # type: ignore
|
||||
import network # type: ignore
|
||||
|
||||
API_KEY = "3545ce42d0ba436e8dc164532250410"
|
||||
ACTUAL_WEATHER_URL = "http://api.weatherapi.com/v1/current.json?key={API_KEY}&q={city}&aqi=yes&lang={lang}"
|
||||
|
||||
|
||||
API_KEY = '3545ce42d0ba436e8dc164532250410'
|
||||
ACTUAL_WEATHER_URL = 'http://api.weatherapi.com/v1/current.json?key={API_KEY}&q={city}&aqi=yes&lang={lang}'
|
||||
class Wlan:
|
||||
def __init__(self):
|
||||
print("Wlan::__init__")
|
||||
self.wlan = network.WLAN(network.STA_IF)
|
||||
def __init__(self):
|
||||
print("Wlan::__init__")
|
||||
self.wlan = network.WLAN(network.STA_IF)
|
||||
|
||||
def connect(self, ssid:str, password:str):
|
||||
|
||||
self.wlan.active(True)
|
||||
self.wlan.connect(ssid, password)
|
||||
def connect(self, ssid: str, password: str):
|
||||
self.wlan.active(True)
|
||||
self.wlan.connect(ssid, password)
|
||||
|
||||
while not self.wlan.isconnected:
|
||||
print('connecting, please wait ...')
|
||||
time.sleep(1)
|
||||
while not self.wlan.isconnected:
|
||||
print("connecting, please wait ...")
|
||||
time.sleep(1)
|
||||
|
||||
print('connected! IP=', self.wlan.ifconfig()[0])
|
||||
time.sleep(0.25)
|
||||
print("connected! IP=", self.wlan.ifconfig()[0])
|
||||
|
||||
Reference in New Issue
Block a user