[WIP] show server state at startup only when initial guess failed

This commit is contained in:
2023-10-17 08:40:11 +02:00
parent 0f39271ff1
commit 0edda9f5c8

View File

@ -311,7 +311,7 @@ class FrappyConfig(Device):
def show_config(self, allcfg, show_server_state=False):
proposed, overview = self.to_consider(allcfg)
if show_server_state == 'auto':
show_server_state = self._previous_shown is not None and overview != self._previous_shown
show_server_state = overview != self._previous_shown
if show_server_state:
for line in overview:
session.log.info('%s', line)
@ -359,7 +359,10 @@ class FrappyConfig(Device):
cfgs['stick'] = running_stick
else:
cfgs.pop('stick', None)
self._initial_config = fm.propose_cfgs(config.instrument, cfgs)[0]
proposed, overview = fm.propose_cfgs(config.instrument, cfgs)
self._initial_config = proposed or {}
if proposed is not None:
self._previous_shown = overview # otherwise the server state will be shown on startup
return self._initial_config.get(service)
def has_changed(self, show_server_state='auto'):