Skip to content

Commit

Permalink
🐛 FIX: check return live data and loading config.json
Browse files Browse the repository at this point in the history
  • Loading branch information
unl0ck committed Jul 10, 2024
1 parent 364df47 commit 3538b6c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .bumpversion-edge.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.bumpversion]
current_version = "2.7.0"
current_version = "2.7.1"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"
Expand Down
6 changes: 6 additions & 0 deletions GridboxConnectorAddon-edge/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<!-- https://developers.home-assistant.io/docs/add-ons/presentation#keeping-a-changelog -->
## 2.7.0

### 🔨 Fixed

- loading config.json
- check response length

## 2.7.0

Expand Down
17 changes: 9 additions & 8 deletions GridboxConnectorAddon-edge/GridboxConnector/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def load_gridbox_config():
options_file = ''
WAIT = int(os.getenv('WAITTIME', "60"))
if os.path.exists(opens_file_path):
options_json = json.load(options_file)
options_file = open(opens_file_path)
options_json = json.load(options_file)
WAIT = int(options_json["wait_time"])


Expand All @@ -54,10 +54,11 @@ def load_gridbox_config():
gridboxConnector = GridboxConnector(gridbox_config)
while True:
measurement = gridboxConnector.retrieve_live_data()
result = measurement[0]
viessmann_gridbox_connector.update_sensors(result)
if one_time_print or logger.level == logging.DEBUG:
logger.info(result)
one_time_print = False
# Wait until fetch new values in seconds
time.sleep(WAIT)
if len(measurement) > 0:
result = measurement[0]
viessmann_gridbox_connector.update_sensors(result)
if one_time_print or logger.level == logging.DEBUG:
logger.info(result)
one_time_print = False
# Wait until fetch new values in seconds
time.sleep(WAIT)
2 changes: 1 addition & 1 deletion GridboxConnectorAddon-edge/cloudSettings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.7.0",
"version": "2.7.1",
"urls": {
"login": "https://gridx.eu.auth0.com/oauth/token",
"gateways": "https://api.gridx.de/gateways",
Expand Down
2 changes: 1 addition & 1 deletion GridboxConnectorAddon-edge/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# https://developers.home-assistant.io/docs/add-ons/configuration#add-on-config
---
name: Viessmann Gridbox Connector (edge)
version: "2.7.0"
version: "2.7.1"
slug: "gridbox_connector_edge"
description: "Viessmann Gridbox Connector (edge)"
url: "https://github.com/unl0ck/homeassistant-addon-viessmann-gridbox/tree/main/GridboxConnectorAddon-edge"
Expand Down
2 changes: 1 addition & 1 deletion GridboxConnectorAddon-edge/rootfs/share/cloudSettings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.7.0",
"version": "2.7.1",
"urls": {
"login": "https://gridx.eu.auth0.com/oauth/token",
"gateways": "https://api.gridx.de/gateways",
Expand Down

0 comments on commit 3538b6c

Please sign in to comment.