Skip to content

Commit

Permalink
Merge pull request #1003 from onkelandy/database
Browse files Browse the repository at this point in the history
database: check if item database config is set to no or false
  • Loading branch information
onkelandy authored Mar 6, 2025
2 parents e72cb7e + c0095f7 commit e97fc7e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions database/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Database(SmartPlugin):
"""

ALLOW_MULTIINSTANCE = True
PLUGIN_VERSION = '1.6.14'
PLUGIN_VERSION = '1.6.15'

# SQL queries: {item} = item table name, {log} = log table name
# time, item_id, val_str, val_num, val_bool, changed
Expand Down Expand Up @@ -209,7 +209,7 @@ def parse_item(self, item):
with the item, caller, source and dest as arguments and in case of the knx plugin the value
can be sent to the knx with a knx write function within the knx plugin.
"""
if self.has_iattr(item.conf, 'database'):
if self.has_iattr(item.conf, 'database') and self.get_iattr_value(item.conf, 'database') not in ['no', 'false']:
self._webdata.update({item.property.path: {}})
self._handled_items.append(item)
if self.has_iattr(item.conf, 'database_maxage'):
Expand Down
6 changes: 3 additions & 3 deletions database/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugin:
keywords: database
support: https://knx-user-forum.de/forum/supportforen/smarthome-py/1021844-neues-database-plugin

version: 1.6.14 # Plugin version
version: 1.6.15 # Plugin version
sh_minversion: '1.9.3.2' # minimum shNG version to use this plugin
# sh_maxversion: # maximum shNG version to use this plugin (leave empty if latest)
multi_instance: True # plugin supports multi instance
Expand Down Expand Up @@ -65,7 +65,7 @@ parameters:
description:
de: 'Genauigkeit der aus der Datenbank ausgelesenen Zeitwerte (Nachkommastellen (für Sekunden)).'
en: 'Precision of time values read from database (digits after comma (for seconds)).'

count_logentries:
type: bool
default: False
Expand Down Expand Up @@ -114,7 +114,7 @@ item_attributes:
# Definition of item attributes defined by this plugin
database:
type: str
valid_list_ci: ['', 'no', 'yes', 'init', 'init2', 'true']
valid_list_ci: ['', 'no', 'yes', 'init', 'init2', 'true', 'false']
duplicate_use: True
description:
de: "Wenn auf 'yes' oder 'true' gesetzt, werden die Werte des Items in die Datenbank geschrieben. Wenn auf 'init' gesetzt, wird zusätzlich beim Start von SmartHomeNG der Wert des Items aus der Datenbank gelesen."
Expand Down

0 comments on commit e97fc7e

Please sign in to comment.