33
44from datetime import datetime , timedelta
55import pandas as pd
6+ import os
67
7- from homeassistant .config_entries import ConfigEntry
88from homeassistant .core import HomeAssistant
99from 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 ()
0 commit comments