From b63e5c8e24dbf595e41a2e24eb794e23ab2756bf Mon Sep 17 00:00:00 2001 From: Cyril Sebastian Date: Tue, 4 Jul 2023 10:46:29 -0700 Subject: [PATCH] fix config path --- README.md | 1 + example.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d20c677..f1c18f3 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,7 @@ if ($headers['Authorization'] != "Bearer 123456789") { } $json_data = json_decode(file_get_contents('php://input'), true); ``` + ## Compatibility | Device | Adapter | Tested | | -------- | :--------: | :--------: | diff --git a/example.py b/example.py index 986b0a8..1f7ca9d 100644 --- a/example.py +++ b/example.py @@ -1,12 +1,14 @@ import logging import configparser +import os from renogybt import BTOneClient from renogybt import DataLogger logging.basicConfig(level=logging.DEBUG) +config_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'config.ini') config = configparser.ConfigParser() -config.read('config.ini') +config.read(config_file) data_logger: DataLogger = DataLogger(config) def on_data_received(client: BTOneClient, data):