Skip to content

Commit

Permalink
Fixing login - md5 password
Browse files Browse the repository at this point in the history
  • Loading branch information
macxq committed Oct 13, 2021
1 parent ebfd888 commit 9fa62f1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from datetime import datetime
import logging
import json
import hashlib

import voluptuous as vol

Expand Down Expand Up @@ -59,8 +60,11 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
username = config.get(CONF_USERNAME)
password = config.get(CONF_PASSWORD)
deviceID = config.get(CONF_DEVICEID)

hashedPassword = hashlib.md5(password.encode()).hexdigest()

methodAuth = "POST"
payloadAuth = {"user": username ,"password":password}
payloadAuth = {"user": username ,"password":hashedPassword}
verify_ssl = DEFAULT_VERIFY_SSL
headersAuth = {"Content-Type":"application/json;charset=UTF-8","Accept":"application/json, text/plain, */*","lang":"en"}

Expand Down

0 comments on commit 9fa62f1

Please sign in to comment.