From ef2419bbc88b343174ae9f41f2356fdcb3e1f47f Mon Sep 17 00:00:00 2001 From: Patrick Pichon Date: Tue, 24 Dec 2024 10:46:51 +0100 Subject: [PATCH 1/2] do not store nor use Domoticz database for plugin db --- plugin.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugin.py b/plugin.py index 0c245cae1..79e9e16d9 100644 --- a/plugin.py +++ b/plugin.py @@ -395,6 +395,9 @@ def onStart(self): self.zigbee_communication, self.VersionNewFashion, self.DomoticzMajor, self.DomoticzMinor, Parameters["HomeFolder"], self.HardwareID ) + self.pluginconf.pluginConf["useDomoticzDatabase"] = False + self.pluginconf.pluginConf["storeDomoticzDatabase"] = False + if self.internet_available is None: self.internet_available = is_internet_available() From d65b05ab71c3222e3049cea821ed918004311ea2 Mon Sep 17 00:00:00 2001 From: Patrick Pichon Date: Tue, 24 Dec 2024 10:47:35 +0100 Subject: [PATCH 2/2] more resilient when reading Domoticz db --- Classes/PluginConf.py | 4 ++-- Modules/database.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Classes/PluginConf.py b/Classes/PluginConf.py index c64b462c8..01eb9129e 100644 --- a/Classes/PluginConf.py +++ b/Classes/PluginConf.py @@ -547,8 +547,8 @@ def _load_Settings(self): if is_domoticz_db_available(self): _domoticz_pluginConf = getConfigItem(Key="PluginConf") if "TimeStamp" in _domoticz_pluginConf: - dz_timestamp = _domoticz_pluginConf["TimeStamp"] - _domoticz_pluginConf = _domoticz_pluginConf["b64Settings"] + dz_timestamp = _domoticz_pluginConf.get("TimeStamp",0) + _domoticz_pluginConf = _domoticz_pluginConf.get("b64Settings",{}) Domoticz.Log( "Plugin data loaded where saved on %s" % (time.strftime("%A, %Y-%m-%d %H:%M:%S", time.localtime(dz_timestamp))) diff --git a/Modules/database.py b/Modules/database.py index 7e6c71889..2c3b561dc 100644 --- a/Modules/database.py +++ b/Modules/database.py @@ -284,8 +284,8 @@ def _read_DeviceList_Domoticz(self): ListOfDevices_from_Domoticz = getConfigItem(Key="ListOfDevices", Attribute="Devices") time_stamp = 0 if "TimeStamp" in ListOfDevices_from_Domoticz: - time_stamp = ListOfDevices_from_Domoticz["TimeStamp"] - ListOfDevices_from_Domoticz = ListOfDevices_from_Domoticz["Devices"] + time_stamp = ListOfDevices_from_Domoticz.get("TimeStamp",0) + ListOfDevices_from_Domoticz = ListOfDevices_from_Domoticz.get("Devices",{}) self.log.logging( "Database", "Log",