-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Is your feature request related to a problem? Please describe.
ThingServer.__init__ has several arguments that are passed internally to ThingServerConfig(). Currently, the only way to use an instance of ThingServerConfig is to pass it to ThingServer.from_config which dumps it to a dictionary and then re-creates it in ThingServer.__init__.
This results in several places that all list the arguments to ThingServerConfig and some ugly code.
Describe the solution you'd like
ThingServer.__init__ should be able to accept a ThingServerConfig which is then used directly, without further processing. It should still be able to accept things and other arguments, probably using **kwargs.
Mostly, this just deduplicates the code, but it also means that subclassed config models will stay as instances of the subclass, rather than reverted to a base ThingServerConfig instance. This ought to make life easier for downstream code that wants to define a model for application_config.