Skip to content

Commit 40b096c

Browse files
committed
250504.2
1 parent 4441b23 commit 40b096c

File tree

7 files changed

+139
-87
lines changed

7 files changed

+139
-87
lines changed

config.ecs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,7 @@ MasterDeviceClick:
871871
log `Select the master device`
872872
set IsMaster
873873
put MasterDevice into Device
874+
log prettify Device
874875
gosub to PopulateDeviceInfo
875876
end
876877
gosub to ManageButtonStates
@@ -884,6 +885,13 @@ PopulateDeviceInfo:
884885
log `Populate device ` cat property `name` of Device
885886
set the text of DeviceNameInput to property `name` of Device
886887
set the text of SSIDLabel to property `ssid` of Device
888+
put property `pins` of Device into Pins
889+
put property `led` of Pins into Pin
890+
set the text of LEDPinInput to property `pin` of Pin
891+
put property `relay` of Pins into Pin
892+
set the text of RelayPinInput to property `pin` of Pin
893+
put property `dht22` of Pins into Pin
894+
set the text of DHT22PinInput to property `pin` of Pin
887895
enable UpdateFilesButton
888896
enable DeleteFileButton
889897
end
@@ -1079,6 +1087,19 @@ UpdateWidgetDataClick:
10791087
gosub to SetBusy
10801088
put property `name` of Device into Previous
10811089
set property `name` of Device to DeviceNameInput
1090+
put json `{}` into Pins
1091+
put json `{}` into Pin
1092+
set property `pin` of Pin to LEDPinInput
1093+
set property `invert` of Pin to LEDInvertCheckbox
1094+
set property `led` of Pins to Pin
1095+
put json `{}` into Pin
1096+
set property `pin` of Pin to RelayPinInput
1097+
set property `invert` of Pin to RelayInvertCheckbox
1098+
set property `relay` of Pins to Pin
1099+
put json `{}` into Pin
1100+
set property `pin` of Pin to DHT22PinInput
1101+
set property `dht22` of Pins to Pin
1102+
set property `pins` of Device to Pins
10821103
put `config.json` into FileName
10831104
put stringify Device into Content
10841105
gosub to SendFileToDevice
@@ -1093,6 +1114,7 @@ UpdateWidgetDataClick:
10931114
delete property Previous of Devices
10941115
gosub to UpdateSystemConfig
10951116
gosub to PostConfigData
1117+
gosub to RequestReset
10961118
end
10971119
gosub to ManageButtonStates
10981120
stop
Binary file not shown.

easycoder/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
from .ec_timestamp import *
1010
from .ec_value import *
1111

12-
__version__ = "250504.1"
12+
__version__ = "250504.2"

easycoder/ec_pyside.py

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -889,36 +889,35 @@ def compileValue(self):
889889
value['domain'] = self.getName()
890890
token = self.getToken()
891891
if self.isSymbol():
892-
value['name'] = token
893-
value['type'] = 'symbol'
894-
return value
895-
896-
if self.tokenIs('the'):
897-
self.nextToken()
898-
token = self.getToken()
899-
900-
if token == 'count':
901-
self.skip('of')
902-
if self.nextIsSymbol():
903-
value['type'] = 'symbol'
904-
record = self.getSymbolRecord()
905-
keyword = record['keyword']
906-
if keyword in ['combobox', 'listbox']:
907-
value['type'] = 'count'
908-
value['name'] = record['name']
909-
return value
910-
911-
if token == 'current':
912-
self.skip('item')
913-
self.skip('in')
914-
if self.nextIsSymbol():
892+
if self.getSymbolRecord()['extra'] == 'gui':
893+
value['name'] = token
915894
value['type'] = 'symbol'
916-
record = self.getSymbolRecord()
917-
keyword = record['keyword']
918-
if keyword == 'listbox':
919-
value['type'] = 'current'
920-
value['name'] = record['name']
921-
return value
895+
return value
896+
897+
else:
898+
if self.tokenIs('the'): token = self.nextToken()
899+
if token == 'count':
900+
self.skip('of')
901+
if self.nextIsSymbol():
902+
value['type'] = 'symbol'
903+
record = self.getSymbolRecord()
904+
keyword = record['keyword']
905+
if keyword in ['combobox', 'listbox']:
906+
value['type'] = 'count'
907+
value['name'] = record['name']
908+
return value
909+
910+
elif token == 'current':
911+
self.skip('item')
912+
self.skip('in')
913+
if self.nextIsSymbol():
914+
value['type'] = 'symbol'
915+
record = self.getSymbolRecord()
916+
keyword = record['keyword']
917+
if keyword == 'listbox':
918+
value['type'] = 'current'
919+
value['name'] = record['name']
920+
return value
922921

923922
return None
924923

@@ -959,6 +958,13 @@ def v_symbol(self, symbolRecord):
959958
v['type'] = 'text'
960959
v['content'] = content
961960
return v
961+
elif keyword == 'checkbox':
962+
checkbox = symbolRecord['widget']
963+
content = checkbox.isChecked()
964+
v = {}
965+
v['type'] = 'boolean'
966+
v['content'] = content
967+
return v
962968
return None
963969

964970
def v_count(self, v):

0 commit comments

Comments
 (0)