You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/modules.md
+14
Original file line number
Diff line number
Diff line change
@@ -109,6 +109,20 @@ This configuration will be then loaded into the `module_config` dictionary for c
109
109
Please place code that loads the module configuration into the `load_config` method,
110
110
where you will recieve both the `platform_config` and `module_config` as arguments.
111
111
112
+
## Reloading configuration
113
+
114
+
The module configuration can be reloaded during runtime using the [Control](configuration/control.md) API, specifically the [`refresh_module_config`](configuration/control.md#refresh_module_config) action.
115
+
This will cause the `load_config` method to be called again, with the new configuration.
116
+
For this reason it is recommended to place all configuration loading code into the `load_config` method.
117
+
118
+
Some callbacks may be called only sparsely in the lifetime of an entity,
119
+
and it may be useful to refresh all the values derived by the module when the configuration changes.
120
+
This is implemented for the [`on_entity_creation`](#entity-on_entity_creation-hook)
121
+
and [`on_new_attr`](#attribute-hooks) callbacks,
122
+
and you can enable it by passing the `refresh` keyword argument
123
+
to the callback registration. See the Callbacks section for more details.
124
+
125
+
112
126
## Callbacks
113
127
114
128
The `registrar:` [`CallbackRegistrar`][dp3.common.callback_registrar.CallbackRegistrar] object
0 commit comments