getValueWithMac

This commit is contained in:
jokob-sk
2024-07-03 08:26:00 +10:00
parent b86ab576bd
commit 7c22f209d1
3 changed files with 13 additions and 2 deletions

View File

@@ -5,7 +5,7 @@
"API_icon": "<i class=\"fa fa-arrow-down-up-across-line\"></i>",
"APPRISE_HOST_description": "Apprise host URL starting with <code>http://</code> or <code>https://</code>. (do not forget to include <code>/notify</code> at the end)",
"APPRISE_HOST_name": "Apprise host URL",
"APPRISE_PAYLOAD_description": "Select the payoad type sent to Apprise. For example <code>html</code> works well with emails, <code>text</code> with chat apps, such as Telegram.",
"APPRISE_PAYLOAD_description": "Select the payload type sent to Apprise. For example <code>html</code> works well with emails, <code>text</code> with chat apps, such as Telegram.",
"APPRISE_PAYLOAD_name": "Payload type",
"APPRISE_SIZE_description": "The maximum size of the apprise payload as number of characters in the passed string. If above limit, it will be truncated and a <code>(text was truncated)</code> message is appended.",
"APPRISE_SIZE_name": "Max payload size",

View File

@@ -444,7 +444,7 @@
"description": [
{
"language_code": "en_us",
"string": "Select the payoad type sent to Apprise. For example <code>html</code> works well with emails, <code>text</code> with chat apps, such as Telegram."
"string": "Select the payload type sent to Apprise. For example <code>html</code> works well with emails, <code>text</code> with chat apps, such as Telegram."
},
{
"language_code": "es_es",

View File

@@ -29,6 +29,17 @@ class Device_obj:
""")
return self.db.sql.fetchall()
# Get specific column value based on dev_MAC
def getValueWithMac(self, column_name, dev_MAC):
query = f"SELECT {column_name} FROM Devices WHERE dev_MAC = ?"
self.db.sql.execute(query, (dev_MAC,))
result = self.db.sql.fetchone()
return result[column_name] if result else None
#-------------------------------------------------------------------------------
def save_scanned_devices (db):