View Single Post
Old 03-15-2021, 09:48 AM   #384
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,493
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by capink View Post
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

Last edited by chaley; 03-15-2021 at 09:54 AM.
chaley is offline   Reply With Quote