mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-09 17:07:43 +01:00
transfer guiversion to gui
This commit is contained in:
parent
366d6cbe91
commit
56ec309dab
3 changed files with 10 additions and 3 deletions
|
@ -1,3 +1,3 @@
|
|||
__version__ = "4.1.0.rc6"
|
||||
__version__ = "4.1.0.rc7"
|
||||
__codename__ = "Groundhog Day"
|
||||
|
||||
|
|
|
@ -190,14 +190,14 @@ class PluginController():
|
|||
|
||||
return result
|
||||
|
||||
async def load_plugin_list(self):
|
||||
async def load_plugin_list(self, filter="cbpi"):
|
||||
result = []
|
||||
try:
|
||||
discovered_plugins = {
|
||||
name: importlib.import_module(name)
|
||||
for finder, name, ispkg
|
||||
in pkgutil.iter_modules()
|
||||
if name.startswith('cbpi') and len(name) > 4
|
||||
if name.startswith(filter) and len(name) > 4
|
||||
}
|
||||
for key, module in discovered_plugins.items():
|
||||
from importlib.metadata import version
|
||||
|
|
|
@ -28,6 +28,12 @@ class SystemHttpEndpoints:
|
|||
"200":
|
||||
description: successful operation
|
||||
"""
|
||||
plugin_list = await self.cbpi.plugin.load_plugin_list("cbpi4gui")
|
||||
try:
|
||||
version= plugin_list[0].get("Version", "not detected")
|
||||
except:
|
||||
version="not detected"
|
||||
|
||||
return web.json_response(data=dict(
|
||||
actor=self.cbpi.actor.get_state(),
|
||||
fermenter=self.cbpi.fermenter.get_state(),
|
||||
|
@ -37,6 +43,7 @@ class SystemHttpEndpoints:
|
|||
fermentersteps=self.cbpi.fermenter.get_fermenter_steps(),
|
||||
config=self.cbpi.config.get_state(),
|
||||
version=__version__,
|
||||
guiversion=version,
|
||||
codename=__codename__)
|
||||
, dumps=json_dumps)
|
||||
|
||||
|
|
Loading…
Reference in a new issue