Quote:
Originally Posted by capink
Still showing the device name. Should I update anything beside sr/calibre/gui2/device.py?
|
No, that is what must be updated.
It works for me. Here is the log:
Code:
Action Chains: Starting event: Device Disconnected
calling method (init_cache) of obj (selection_count)
('template', '')
calling method (flush_cache) of obj (selection_count)
Action Chains: Starting chain: Test bool
Action Chains: Test bool: starting action No. 1: Single Field Edit
('template', '')
Action Chains: chain (Test bool) finished in: 0:00:00.075093
Action Chains: event (Device Disconnected) finished in: 0.07902860641479492
The action triggered by the event manager is
Code:
{
"action_name": "Single Field Edit",
"action_settings": {
"col_name": "#mybool",
"template": "program: \n\tprint('template', connected_device_name('main'));\n\t'Yes'",
"value_type": "template"
},
"comment": ""
}
EDIT: for completeness, here is the device connected log using the same chain
Code:
Action Chains: Starting event: Device Connected
calling method (init_cache) of obj (selection_count)
('template', 'Folder Device')
calling method (flush_cache) of obj (selection_count)
Action Chains: Starting chain: Test bool
Action Chains: Test bool: starting action No. 1: Single Field Edit
('template', 'Folder Device')
Action Chains: chain (Test bool) finished in: 0:00:00.040365
Action Chains: event (Device Connected) finished in: 0.04210329055786133