Unprivate conn_menu

Used for autoconnect
This commit is contained in:
atse 2024-09-09 15:00:14 +08:00
parent f1d00ca57d
commit f569b46d51
1 changed files with 6 additions and 6 deletions

View File

@ -107,8 +107,8 @@ class MainWindow(QtWidgets.QMainWindow):
)
# Bottom bar menus
self._conn_menu = ConnMenu(self._thermostat, self.connect_btn)
self.connect_btn.setMenu(self._conn_menu)
self.conn_menu = ConnMenu(self._thermostat, self.connect_btn)
self.connect_btn.setMenu(self.conn_menu)
self._thermostat_ctrl_menu = ThermostatCtrlMenu(
self._thermostat, self._info_box, self.style()
@ -189,8 +189,8 @@ class MainWindow(QtWidgets.QMainWindow):
case ThermostatConnectionState.DISCONNECTED:
self._connecting_task = asyncio.create_task(
self._thermostat.start_session(
host=self._conn_menu.host_set_line.text(),
port=self._conn_menu.port_set_spin.value(),
host=self.conn_menu.host_set_line.text(),
port=self.conn_menu.port_set_spin.value(),
)
)
self._thermostat.connection_state = ThermostatConnectionState.CONNECTING
@ -234,9 +234,9 @@ async def coro_main():
if args.connect:
if args.HOST:
main_window._conn_menu.host_set_line.setText(args.HOST)
main_window.conn_menu.host_set_line.setText(args.HOST)
if args.PORT:
main_window._conn_menu.port_set_spin.setValue(int(args.PORT))
main_window.conn_menu.port_set_spin.setValue(int(args.PORT))
main_window.connect_btn.click()
await app_quit_event.wait()