Skip to content

Commit 965006a

Browse files
committed
Fixed file path error
1 parent af97bc7 commit 965006a

3 files changed

Lines changed: 16 additions & 6 deletions

File tree

custom_components/debug_heat_pump/const.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
NAME = "Debug Heat Pump"
77
DOMAIN = "debug_heat_pump"
8-
VERSION = "0.0.3"
8+
VERSION = "0.0.4"
99
ATTRIBUTION = "Attribution"
1010

1111
MODE = "debug_heat_pump_mode"

custom_components/debug_heat_pump/coordinator.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
from datetime import datetime, timedelta
55
import pandas as pd
6+
import os
67

7-
from homeassistant.config_entries import ConfigEntry
88
from homeassistant.core import HomeAssistant
99
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
1010

@@ -28,9 +28,19 @@ def __init__(
2828
update_interval=timedelta(seconds=60),
2929
)
3030

31-
csv_file_path = self.hass.config.path().split('/')[:-1]
32-
csv_file_path.extend(['custom_components', 'debug_heat_pump', 'data', 'Property_ID=EOH3204_cropped.csv'])
33-
csv_file_path = '/'.join(csv_file_path)
31+
csv_file_path = self.hass.config.path()
32+
csv_file_path = os.path.join(
33+
csv_file_path,
34+
'custom_components/debug_heat_pump/data/Property_ID=EOH3204_cropped.csv')
35+
36+
# If we are developing the integration the file path will be different.
37+
developing_integration = False
38+
if developing_integration:
39+
csv_file_path = self.hass.config.path().split('/')[:-1]
40+
csv_file_path.extend(['custom_components', 'debug_heat_pump', 'data', 'Property_ID=EOH3204_cropped.csv'])
41+
csv_file_path = '/'.join(csv_file_path)
42+
#csv_file_path.extend(['custom_components', 'debug_heat_pump', 'data', 'Property_ID=EOH3204_cropped.csv'])
43+
#csv_file_path = '/'.join(csv_file_path)
3444
df = pd.read_csv(csv_file_path)
3545
df = df[15249:-22630] # 2022/01/01 00:00:00 - 2022/08/24 23:58:00
3646
self._external_air_temperature = df['External_Air_Temperature'].to_numpy()

custom_components/debug_heat_pump/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
"requirements": [
1212
"pandas>=2.1.4"
1313
],
14-
"version": "0.0.3"
14+
"version": "0.0.4"
1515
}

0 commit comments

Comments
 (0)