Selaa lähdekoodia

Put parameter into cache after adding

tags/3.0
Manuel83 8 vuotta sitten
vanhempi
commit
bcd07e4705
1 muutettua tiedostoa jossa 3 lisäystä ja 2 poistoa
  1. +3
    -2
      modules/core/core.py

+ 3
- 2
modules/core/core.py Näytä tiedosto

@@ -251,8 +251,9 @@ class CraftBeerPi(ActorAPI, SensorAPI):
def add_config_parameter(self, name, value, type, description, options=None):
from modules.config import Config
with self.app.app_context():
Config.insert(**{"name":name, "value": value, "type": type, "description": description, "options": options})

c = Config.insert(**{"name":name, "value": value, "type": type, "description": description, "options": options})
if self.cache.get("config") is not None:
self.cache.get("config")[c.name] = c

def clear_cache(self, key, is_array=False):
if is_array:


Loading…
Peruuta
Tallenna