Is your feature request related to a problem? Please describe.
As of #110, settings are available before the Thing is attached to a ThingServer, but their values may be overwritten once it is attached. This has the potential to be quite confusing.
Describe the solution you'd like
Reading or writing ThingSetting descriptors on a Thing that is not attached to a ThingServer should raise an error. There should be a clear and simple way to silence the error (e.g. for tests, or if the author is confident they want the current behaviour).
Additional context
Thing subclasses should not do very much in __init__ beyond setting defaults and remembering initialisation arguments, because it's not appropriate to communicate with hardware before __enter__ is called. However, this is not currently enforced. If settings are manipulated during __init__ they may change unexpectedly between __init__ and __enter__, which could cause confusion. I think it might help catch code with the potential to get confusing if an error is raised when settings are used before __enter__.
Is your feature request related to a problem? Please describe.
As of #110, settings are available before the
Thingis attached to aThingServer, but their values may be overwritten once it is attached. This has the potential to be quite confusing.Describe the solution you'd like
Reading or writing
ThingSettingdescriptors on aThingthat is not attached to aThingServershould raise an error. There should be a clear and simple way to silence the error (e.g. for tests, or if the author is confident they want the current behaviour).Additional context
Thingsubclasses should not do very much in__init__beyond setting defaults and remembering initialisation arguments, because it's not appropriate to communicate with hardware before__enter__is called. However, this is not currently enforced. If settings are manipulated during__init__they may change unexpectedly between__init__and__enter__, which could cause confusion. I think it might help catch code with the potential to get confusing if an error is raised when settings are used before__enter__.