fix send_request version message

This commit is contained in:
2026-03-18 16:25:59 -04:00
parent a022c413cc
commit 9737221914
5 changed files with 47 additions and 35 deletions

23
bal.py
View File

@@ -47,18 +47,19 @@ class BalConfig:
class BalPlugin(BasePlugin):
LATEST_VERSION = "1"
KNOWN_VERSIONS = ("0", "1")
assert LATEST_VERSION in KNOWN_VERSIONS
_version=None
def version():
try:
f = ""
with open("VERSION", "r") as fi:
f = str(fi.readline())
return f
except Exception:
return "unknown"
def version(self):
if not self._version:
try:
f = ""
with open("{}/VERSION".format(self.plugin_dir), "r") as fi:
f = str(fi.read())
self._version = f.strip()
except Exception as e:
_logger.error(f"failed to get version: {e}")
self._version="unknown"
return self._version
SIZE = (159, 97)