|
@@ -32,7 +32,7 @@ class Wetation(wx.Frame):
|
32
|
32
|
wx.Frame.__init__(self, *args, **kwds)
|
33
|
33
|
self.SetSize((800, 600))
|
34
|
34
|
self.garage_oc = wx.Button(self, wx.ID_ANY, "Garage")
|
35
|
|
- self.gate_position = wx.Slider(self, wx.ID_ANY, 0, 0, 100)
|
|
35
|
+ self.gate_position = wx.Slider(self, wx.ID_ANY, 50, 0, 100)
|
36
|
36
|
|
37
|
37
|
self.__set_properties()
|
38
|
38
|
self.__do_layout()
|
|
@@ -183,18 +183,23 @@ def initiate_update(rt, frame, prot_out, prot_in, prot_garage):
|
183
|
183
|
|
184
|
184
|
|
185
|
185
|
if __name__ == "__main__":
|
186
|
|
- report.appLoggingConfigure(os.path.dirname(__file__), 'stdout', config.loggers)
|
|
186
|
+ report.appLoggingConfigure(os.path.dirname(__file__), config.LOGTARGET, config.loggers)
|
187
|
187
|
#
|
188
|
188
|
app = MyApp(0)
|
189
|
189
|
#
|
190
|
190
|
# Start TCP-Clients
|
191
|
191
|
c_tcp = tcp_socket.tcp_client_stp(config.server_out_ip, config.server_out_port, rx_log_lvl=logging.DEBUG)
|
192
|
192
|
prot_out = wetation_protocol.my_smarthome_gui_client_protocol_tcp(c_tcp, app.frame.out_temperature, app.frame.out_humidity, app.frame.out_pressure, app.frame.Layout, config.server_out_secret)
|
|
193
|
+ if config.server_out_secret is not None:
|
|
194
|
+ prot_out.authentificate()
|
193
|
195
|
c_tcp = tcp_socket.tcp_client_stp(config.server_in_ip, config.server_in_port, rx_log_lvl=logging.DEBUG)
|
194
|
196
|
prot_in = wetation_protocol.my_smarthome_gui_client_protocol_tcp(c_tcp, app.frame.in_temperature, app.frame.in_humidity, app.frame.in_pressure, app.frame.Layout, config.server_in_secret)
|
|
197
|
+ if config.server_in_secret is not None:
|
|
198
|
+ prot_in.authentificate()
|
195
|
199
|
c_tcp = tcp_socket.tcp_client_stp(config.server_garage_ip, config.server_garage_port, rx_log_lvl=logging.DEBUG)
|
196
|
200
|
prot_garage = garage_protocol.my_smarthome_gui_client_protocol_tcp(c_tcp, app.frame.gate_position, app.frame.Layout, config.server_garage_secret)
|
197
|
|
- prot_garage.authentificate()
|
|
201
|
+ if config.server_garage_secret is not None:
|
|
202
|
+ prot_garage.authentificate()
|
198
|
203
|
app.frame.prot_garage = prot_garage
|
199
|
204
|
pt = task.periodic(10, initiate_update, app.frame, prot_out, prot_in, prot_garage)
|
200
|
205
|
pt.run()
|