forked from M-Labs/thermostat
Unprivate conn_menu
Used for autoconnect
This commit is contained in:
parent
9c0c6ab323
commit
28a76d091d
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user