Fix dashboard wizard unicode (#494)

* Fix dashboard wizard unicode

Fixes https://github.com/esphome/issues/issues/169

* Fix password md5
This commit is contained in:
Otto Winter
2019-03-31 11:04:41 +02:00
parent 300d3a1f46
commit e7e785fd60
4 changed files with 15 additions and 5 deletions
+10
View File
@@ -69,3 +69,13 @@ def indexbytes(buf, i):
return buf[i]
else:
return ord(buf[i])
if IS_PY2:
def decode_text(data, encoding='utf-8', errors='strict'):
# type: (str, str, str) -> unicode
return unicode(data, encoding='utf-8', errors=errors)
else:
def decode_text(data, encoding='utf-8', errors='strict'):
# type: (bytes, str, str) -> str
return data.decode(encoding='utf-8', errors=errors)