diff --git a/ledd/controller.py b/ledd/controller.py index 8e96500..82c6e1e 100644 --- a/ledd/controller.py +++ b/ledd/controller.py @@ -57,7 +57,6 @@ class Controller(Base): A controller controls a number of stripes. """ - @reconstructor def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self._mode = None @@ -65,6 +64,13 @@ class Controller(Base): self._address = int(self.address, 16) self.pwm_freq = self._pwm_freq + @reconstructor + def init_on_load(self): + self._mode = None + self.bus = smbus.SMBus(self.i2c_device) + self._address = int(self.address, 16) + self.pwm_freq = self._pwm_freq + def __repr__(self): return "".format(len(self.stripes), self.id)