Skip to content

Commit 28a49d2

Browse files
authored
Merge pull request #30 from BigManDave/main
ISSUE 28 - Add User-Agent header
2 parents ec19875 + fb8d8a0 commit 28a49d2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

custom_components/foxess/sensor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
103103
async def async_update_data():
104104
allData = {}
105105
token = await authAndgetToken(hass, username, hashedPassword)
106-
headersData = {"token": token}
106+
headersData = {"token": token, "User-Agent": "Chrome"}
107107

108108
await getErnings(hass, headersData, allData, deviceID)
109109
await getAddresbook(hass, headersData, allData, deviceID)
@@ -139,7 +139,7 @@ async def authAndgetToken(hass, username, hashedPassword):
139139

140140
payloadAuth = {"user": username, "password": hashedPassword}
141141
headersAuth = {"Content-Type": "application/json;charset=UTF-8",
142-
"Accept": "application/json, text/plain, */*", "lang": "en"}
142+
"Accept": "application/json, text/plain, */*", "lang": "en", "User-Agent": "Chrome"}
143143

144144
restAuth = RestData(hass, METHOD_POST, _ENDPOINT_AUTH, None,
145145
headersAuth, None, payloadAuth, DEFAULT_VERIFY_SSL)

0 commit comments

Comments
 (0)