Skip to content

Commit

Permalink
XDevice: Add sleep_interval_sec passthru property read from config
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-long committed Dec 22, 2023
1 parent 89fde2e commit c06c85c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python/magaox/indi/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ class XDevice(Device):
def default_config_path(cls):
return cls.prefix_dir + "/" + cls.config_dir + "/" + cls.__name__ + ".conf"

@property
def sleep_interval_sec(self):
'''Sleep between executions of loop()
Note this overrides the superclass class attribute with a read-only property
referencing the config via `BaseConfig.sleep_interval_sec`'''
return self.config.sleep_interval_sec

@classmethod
def load_config(cls, filenames, overrides):
config_class : BaseConfig = typing.get_type_hints(cls)['config']
Expand Down

0 comments on commit c06c85c

Please sign in to comment.