Pylint & corrections

This commit is contained in:
arofarn 2020-04-21 20:58:14 +02:00
parent e7212ebc1f
commit 84dfa554b0
3 changed files with 11 additions and 15 deletions

View File

@ -6,7 +6,7 @@ import gc
import time import time
import network import network
import webrepl import webrepl
from config import known_wifi_ap from config import KNOWN_WIFI_AP
# Connect to one of the known wifi AP # Connect to one of the known wifi AP
WLAN = network.WLAN(network.STA_IF) WLAN = network.WLAN(network.STA_IF)
@ -18,10 +18,10 @@ for ap in AP_LIST:
break break
ap_ssid = ap[0].decode("utf-8") ap_ssid = ap[0].decode("utf-8")
if ap_ssid in known_wifi_ap.keys(): if ap_ssid in KNOWN_WIFI_AP.keys():
print("Known wifi network found : {}".format(ap_ssid)) print("Known wifi network found : {}".format(ap_ssid))
print("Try to connect...") print("Try to connect...")
WLAN.connect(ap_ssid, known_wifi_ap[ap_ssid]) WLAN.connect(ap_ssid, KNOWN_WIFI_AP[ap_ssid])
DELAY = 0 DELAY = 0

View File

@ -55,7 +55,8 @@ def fill_white(np_strp, col=(255, 255, 255)):
:param np_strp : NeoPixel object :param np_strp : NeoPixel object
:param col : color [R, G, B] (ignored, default=(255, 255, 255)) :param col : color [R, G, B] (ignored, default=(255, 255, 255))
""" """
np_strp.fill((255, 255, 255)) col = (255, 255, 255)
np_strp.fill(col)
def sparkles(np_strp, col): def sparkles(np_strp, col):
@ -67,11 +68,10 @@ def sparkles(np_strp, col):
np_strp[pix] = col np_strp[pix] = col
def christmas(np_strp, col): # def christmas(np_strp, col):
"""Shine like christmas tree °<:oD # """Shine like christmas tree °<:oD
TODO !!! # TODO !!!
""" # """
pass
MODES_LST = (fill_usr, fill_white, sparkles) MODES_LST = (fill_usr, fill_white, sparkles)

View File

@ -21,7 +21,6 @@ __version__ = 0.3
# Imports # Imports
import time import time
import sys
import machine import machine
import esp import esp
import neopixel import neopixel
@ -123,8 +122,6 @@ def MqttMultiPublish(payload, sleep=0):
def power_cycle(): def power_cycle():
"""ON/OFF function""" """ON/OFF function"""
global PWR
global BRIGHTN
PWR = not PWR PWR = not PWR
print("Power :", PWR) print("Power :", PWR)
@ -185,9 +182,8 @@ def update_button_c(button, button_state, pwr, mode):
def update_wifi_led(): def update_wifi_led():
"""Refresh Wifi status LED""" """Refresh Wifi status LED"""
global WIFI_LED
global WLAN WIFI_LED.value = not WLAN.isconnected()
WIFI_LED = WLAN.isconnected()
##################### #####################