chestm007 / linux_thermaltake_riing

Python driver and daemon to control thermaltake Riing fans and pumps
GNU General Public License v2.0
61 stars 25 forks source link

Startup Failure: AttributeError: 'NoneType' object has no attribute 'reset' #49

Open jlong23 opened 3 years ago

jlong23 commented 3 years ago

python ./run.py initializing thermaltake rgb daemon loading config raw config file start

controllers:

end

/home/jlong/dev/linux_thermaltake_riing/linux_thermaltake_rgb/daemon/config.py:61: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. return yaml.load(cfg) [{'unit': 1, 'type': 'g3', 'devices': {1: 'Riing Plus', 2: 'Riing Plus', 3: 'Riing Plus', 4: 'Floe Riing RGB'}}] {'model': 'locked_speed', 'speed': 50} {'model': 'full', 'r': 40, 'g': 0, 'b': 0} creating fan manager creating FanManager object: [model: locked speed 50%] creating lighting manager initializing FullLightingEffect light controller configuring controllers Traceback (most recent call last): File "./run.py", line 21, in main() File "./run.py", line 13, in main daemon = ThermaltakeDaemon() File "/home/jlong/dev/linux_thermaltake_riing/linux_thermaltake_rgb/daemon/daemon.py", line 50, in init self.controllers[controller['unit']] = ThermaltakeController.factory(controller['type'], controller.get('unit')) File "/home/jlong/dev/linux_thermaltake_riing/linux_thermaltake_rgb/controllers.py", line 40, in factory return subclass_dict.get(unit_type.lower())(unit=unit_identifier) File "/home/jlong/dev/linux_thermaltake_riing/linux_thermaltake_rgb/controllers.py", line 61, in init super().init() File "/home/jlong/dev/linux_thermaltake_riing/linux_thermaltake_rgb/controllers.py", line 30, in init self.init() File "/home/jlong/dev/linux_thermaltake_riing/linux_thermaltake_rgb/controllers.py", line 67, in init self.driver = drivers.ThermaltakeG3ControllerDriver(self.unit) File "/home/jlong/dev/linux_thermaltake_riing/linux_thermaltake_rgb/drivers.py", line 34, in init self._initialize_device() File "/home/jlong/dev/linux_thermaltake_riing/linux_thermaltake_rgb/drivers.py", line 43, in _initialize_device self.device.reset() AttributeError: 'NoneType' object has no attribute 'reset'

Phles commented 1 year ago

I encountered this same problem, did some digging and it appears that the USB device for the controller was not found.

def _initialize_device(self):
        self.device = usb.core.find(idVendor=self.vendor_id,
                                    idProduct=self.product_id)
        # fail safe incase last device usage was dirty
        self.device.reset()

        if self.device is None:
            raise ValueError('Device not found')

I am going to check if there are any USB connections to the controller I am missing.