Skip to content

Commit

Permalink
Merge pull request #37 from Rmvandiepen/solve_cache_issue_with_multip…
Browse files Browse the repository at this point in the history
…le_inverters

fix: Prevent today_cache being shared when multiple inverters are used at the same time
  • Loading branch information
robbinjanssen authored May 21, 2021
2 parents 5af9823 + 92c3105 commit 06c87de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion custom_components/omnik_inverter/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"domain": "omnik_inverter",
"name": "Omnik Inverter",
"version": "1.5.3",
"version": "1.5.4",
"documentation": "https://github.com/robbinjanssen/home-assistant-omnik-inverter",
"dependencies": [],
"codeowners": [
Expand Down
6 changes: 3 additions & 3 deletions custom_components/omnik_inverter/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

import re

VERSION = '1.5.3'
VERSION = '1.5.4'

CONF_CACHE_POWER_TODAY = 'cache_power_today'
CONF_USE_JSON = 'use_json'
Expand All @@ -36,7 +36,7 @@

JS_URL = 'http://{0}/js/status.js'
JSON_URL = 'http://{0}/status.json?CMD=inv_query&rand={1}'
CACHE_NAME = '.{0}.json'
CACHE_NAME = '.{0}{1}.json'
CACHE_VALUE_KEY = "cache_value"
CACHE_DAY_KEY = "cache_day"

Expand Down Expand Up @@ -183,7 +183,7 @@ def __init__(self, data, sensor_type, name, cache, cache_name):

# Set caching data.
self._cache = cache
self._cache_name = cache_name.format(self._type)
self._cache_name = cache_name.format(name, self._type)

# Trigger an update to get the unique ID.
self.update()
Expand Down

0 comments on commit 06c87de

Please sign in to comment.