diff --git a/openrgb/orgb.py b/openrgb/orgb.py index ea1b4ed..af0ce68 100644 --- a/openrgb/orgb.py +++ b/openrgb/orgb.py @@ -420,7 +420,10 @@ def _callback(self, device: int, type: int, data: Any): elif type == utils.PacketType.REQUEST_PLUGIN_LIST: for plugin in data: if (all(plugin.id != existing.id for existing in self.plugins)): - self.plugins.append(create_plugin(plugin, self.comms)) + # Plugins that are not supported should be skipped + new_plugin = create_plugin(plugin, self.comms) + if new_plugin is not None: + self.plugins.append(new_plugin) elif type == utils.PacketType.PLUGIN_SPECIFIC: next(plugin for plugin in self.plugins if plugin.id == device)._recv(data) diff --git a/openrgb/plugins/__init__.py b/openrgb/plugins/__init__.py index e00cfbb..a964faf 100644 --- a/openrgb/plugins/__init__.py +++ b/openrgb/plugins/__init__.py @@ -1,4 +1,5 @@ from __future__ import annotations +from typing import Optional from openrgb.utils import Plugin from openrgb.network import NetworkClient from openrgb.plugins.common import ORGBPlugin @@ -10,5 +11,13 @@ } -def create_plugin(plugin: Plugin, comms: NetworkClient) -> ORGBPlugin: - return PLUGIN_NAMES[plugin.name](plugin, comms) \ No newline at end of file +def create_plugin(plugin: Plugin, comms: NetworkClient) -> Optional[ORGBPlugin]: + plugin_class = PLUGIN_NAMES.get(plugin.name) + + # There are cases where the plugin metadata from the OpenRGB server is + # entirely empty (version, description, name) - this seems to be when a plugin is + # disabled or in an invalid state + # or we don't support the plugin yet + if plugin_class is None: + return None + return plugin_class(plugin, comms)