Skip to content

Commit

Permalink
Fix - Fixed access to injection_dict for the first time that emhass i…
Browse files Browse the repository at this point in the history
…s used
  • Loading branch information
davidusb-geek committed Jan 31, 2023
1 parent b387bd3 commit c207cf9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [0.3.35] - 2023-01-31
### Fix
- Fixed access to injection_dict for the first time that emhass is used.

## [0.3.34] - 2023-01-30
### Fix
- Fixed bugs with paths again, now using the official pathlib everywhere.
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.3.34'
release = '0.3.35'

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

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.3.34', # Required
version='0.3.35', # 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
10 changes: 5 additions & 5 deletions src/emhass/web_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ def index():
file_loader = PackageLoader('emhass', 'templates')
env = Environment(loader=file_loader)
template = env.get_template('index.html')
# template = render_template('index.html')
# Load cache dict
with open(str(data_path / 'injection_dict.pkl'), "rb") as fid:
injection_dict = pickle.load(fid)
if injection_dict is None:
app.logger.warning("Oops.. The data dictionary is empty... Please launch an optimization task")
if (data_path / 'injection_dict.pkl').exists():
with open(str(data_path / 'injection_dict.pkl'), "rb") as fid:
injection_dict = pickle.load(fid)
else:
app.logger.warning("The data container dictionary is empty... Please launch an optimization task")
injection_dict={}
return make_response(template.render(injection_dict=injection_dict))

Expand Down

0 comments on commit c207cf9

Please sign in to comment.