# Plugins pour PC Monitor
from .base import BasePlugin
from .librehardwaremonitor import LibreHardwareMonitorPlugin
from .hwinfo import HWiNFOPlugin

# Registry des plugins disponibles
PLUGINS = {
    'librehardwaremonitor': LibreHardwareMonitorPlugin,
    'hwinfo': HWiNFOPlugin
}

def get_plugin(name: str, config: dict) -> BasePlugin:
    """Retourne une instance du plugin demandé"""
    if name not in PLUGINS:
        raise ValueError(f"Plugin inconnu: {name}")
    return PLUGINS[name](config)

def get_available_plugins() -> list:
    """Retourne la liste des plugins disponibles"""
    return [
        {
            'id': 'librehardwaremonitor',
            'name': 'LibreHardwareMonitor',
            'description': 'Open source, API REST intégrée',
            'default_port': 8085,
            'website': 'https://github.com/LibreHardwareMonitor/LibreHardwareMonitor'
        },
        {
            'id': 'hwinfo',
            'name': 'HWiNFO + RemoteHWInfo',
            'description': 'HWiNFO avec RemoteHWInfo (github.com/Demion/remotehwinfo)',
            'default_port': 60000,
            'website': 'https://github.com/Demion/remotehwinfo'
        }
    ]
