Skip to content

Commit

Permalink
smartmeter: improve item generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Morg42 committed Dec 17, 2024
1 parent 40517bd commit ad2d812
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions smartmeter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def create_items(self, data: dict = {}, file: str = '') -> bool:

if not file:
dir = self._sh._items_dir
file = os.path.join(dir, f'smartmeter-{id}')
file = os.path.join(dir, f'smartmeter-{id}.yaml')

if os.path.exists(file):
self.logger.warning(f'output file {file} exists, not overwriting.')
Expand Down Expand Up @@ -242,7 +242,7 @@ def create_items(self, data: dict = {}, file: str = '') -> bool:
}

try:
yaml_save(file, result)
yaml_save(file, {id: result})
except Exception as e:
self.logger.warning(f'saving item file {file} failed with error: {e}')
return False
Expand Down

0 comments on commit ad2d812

Please sign in to comment.