Skip to content

Commit

Permalink
Merge pull request #2 from oscarminus/main
Browse files Browse the repository at this point in the history
Add WW_NACHLADEN
Fix incorrect response for BioStar17
  • Loading branch information
a529987659852 authored Feb 18, 2024
2 parents f7759f9 + 5b4284f commit 5d61b2b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions custom_components/GuntamaticBiostar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging
from datetime import timedelta
from typing import Any
import json

import async_timeout
from aiohttp import ClientSession
Expand Down Expand Up @@ -74,10 +75,12 @@ async def _async_get_data(self) -> dict[str, Any]:
)
raise UpdateFailed

r = await resp.text()

if API == APIEndpoints[0]:
dataDescription = await resp.json()
dataDescription = json.loads(r.replace(',,', ','))
elif API == APIEndpoints[1]:
dataValues = await resp.json()
dataValues = json.loads(r.replace(',,', ','))

for i in range(len(dataDescription)):
key = dataDescription[i].get("name")
Expand Down
2 changes: 1 addition & 1 deletion custom_components/GuntamaticBiostar/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,6 @@ class guntamaticSelectEntityDescription(SelectEntityDescription):
"NORMAL",
"WARMWASSER",
],
optionsMapping={"AUS": 0, "NORMAL": 1, "WARMWASSER": 2},
optionsMapping={"AUS": 0, "NORMAL": 1, "WARMWASSER": 2, "WW NACHLADEN": 6},
),
]

0 comments on commit 5d61b2b

Please sign in to comment.