Skip to content

Be clear that thing_settings are not available during __init__ #112

@rwb27

Description

@rwb27

A Thing object should have a ThingSettings object available at self.thing_settings to persist data. Currently, this is supplied when the Thing is added to the server, i.e. after __init__ has run. This has the potential to be quite confusing, I think.

The reason this is done is that we don't know where the settings file should be until there's a server involved - because the settings location is a property of the server. It might be possible to change this, for example by making sure that Things are always instantiated after the server - adding a mandatory server argument or perhaps using a context variable.

Resolution: Keep the current behaviour, but make it clear that settings will only have their values available after the Thing is connected to a ThingServer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions