Skip to content

Commit

Permalink
Feat - Added new solution to DST survive and prepared new version
Browse files Browse the repository at this point in the history
  • Loading branch information
davidusb-geek committed Mar 10, 2024
1 parent 46d6849 commit 600a357
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## [0.8.2] - 2024-03-10
### Improvement
- Proposed a new solution to survive DST using special option of Pandas `round` method
- Added option to `web_server` to init `data_path` as an options param
- Styling docs and html files on webui
- Advanced and basic pages improvements on webui
### Fix
- Fixed support for ARM achitectures

## [0.8.1] - 2024-02-28
### Improvement
- Improved documentation
Expand Down Expand Up @@ -587,6 +596,9 @@ Thanks to @GeoDerp for this great work!
[0.7.6]: https://github.com/davidusb-geek/emhass/releases/tag/v0.7.6
[0.7.7]: https://github.com/davidusb-geek/emhass/releases/tag/v0.7.7
[0.7.8]: https://github.com/davidusb-geek/emhass/releases/tag/v0.7.8
[0.8.0]: https://github.com/davidusb-geek/emhass/releases/tag/v0.8.0
[0.8.1]: https://github.com/davidusb-geek/emhass/releases/tag/v0.8.1
[0.8.2]: https://github.com/davidusb-geek/emhass/releases/tag/v0.8.2

# Notes
All notable changes to this project will be documented in this file.
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = 'David HERNANDEZ'

# The full version, including alpha/beta/rc tags
release = '0.8.1'
release = '0.8.2'

# -- General configuration ---------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion docs/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ docker run ... -v $(pwd)/data/:/app/data ...
```

#### Issue with TARGETARCH
If your docker build fails with an error related to `TARGETARCH`. It may be best to add your devices artitecture this in manually:
If your docker build fails with an error related to `TARGETARCH`. It may be best to add your devices architecture manually:

Example with armhf architecture
```bash
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

setup(
name='emhass', # Required
version='0.8.1', # Required
version='0.8.2', # Required
description='An Energy Management System for Home Assistant', # Optional
long_description=long_description, # Optional
long_description_content_type='text/markdown', # Optional (see note above)
Expand Down
6 changes: 3 additions & 3 deletions src/emhass/forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def __init__(self, retrieve_hass_conf: dict, optim_conf: dict, plant_conf: dict,
self.end_forecast = (self.start_forecast + self.optim_conf['delta_forecast']).replace(microsecond=0)
self.forecast_dates = pd.date_range(start=self.start_forecast,
end=self.end_forecast-self.freq,
freq=self.freq).round(self.freq)
freq=self.freq).round(self.freq, ambiguous='infer', nonexistent=self.freq)
if params is not None:
if 'prediction_horizon' in list(self.params['passed_data'].keys()):
if self.params['passed_data']['prediction_horizon'] is not None:
Expand All @@ -184,7 +184,7 @@ def get_weather_forecast(self, method: Optional[str] = 'scrapper',
freq_scrap = pd.to_timedelta(60, "minutes") # The scrapping time step is 60min
forecast_dates_scrap = pd.date_range(start=self.start_forecast,
end=self.end_forecast-freq_scrap,
freq=freq_scrap).round(freq_scrap)
freq=freq_scrap).round(freq_scrap, ambiguous='infer', nonexistent=freq_scrap)
# Using the clearoutside webpage
response = get("https://clearoutside.com/forecast/"+str(round(self.lat, 2))+"/"+str(round(self.lon, 2))+"?desktop=true")
'''import bz2 # Uncomment to save a serialized data for tests
Expand Down Expand Up @@ -476,7 +476,7 @@ def get_forecast_days_csv(self, timedelta_days: Optional[int] = 1) -> pd.date_ra
end_forecast_csv = (start_forecast_csv + self.optim_conf['delta_forecast']).replace(microsecond=0)
forecast_dates_csv = pd.date_range(start=start_forecast_csv,
end=end_forecast_csv+timedelta(days=timedelta_days)-self.freq,
freq=self.freq).round(self.freq)
freq=self.freq).round(self.freq, ambiguous='infer', nonexistent=self.freq)
if self.params is not None:
if 'prediction_horizon' in list(self.params['passed_data'].keys()):
if self.params['passed_data']['prediction_horizon'] is not None:
Expand Down
2 changes: 1 addition & 1 deletion src/emhass/retrieve_hass.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def get_data(self, days_list: pd.date_range, var_list: list, minimal_response: O
from_date = pd.to_datetime(df_raw['last_changed'], format="ISO8601").min()
to_date = pd.to_datetime(df_raw['last_changed'], format="ISO8601").max()
ts = pd.to_datetime(pd.date_range(start=from_date, end=to_date, freq=self.freq),
format='%Y-%d-%m %H:%M').round(self.freq)
format='%Y-%d-%m %H:%M').round(self.freq, ambiguous='infer', nonexistent=self.freq)
df_day = pd.DataFrame(index = ts)
# Caution with undefined string data: unknown, unavailable, etc.
df_tp = df_raw.copy()[['state']].replace(
Expand Down

0 comments on commit 600a357

Please sign in to comment.