# Path: cardinal/decorators.py
# def command(triggers):
#     if isinstance(triggers, str):
#         triggers = [triggers]
# 
#     if not isinstance(triggers, list):
#         raise TypeError("Command must be a trigger string or list of triggers")
# 
#     def wrap(f):
#         f.commands = triggers
#         return f
# 
#     return wrap
# 
# def help(lines):
#     # For backwards compatibility
#     if isinstance(lines, str):
#         lines = [lines]
# 
#     if not isinstance(lines, list):
#         raise TypeError("Help must be a help string or list of help strings")
# 
#     def wrap(f):
#         # Create help list or prepend to it
#         if not hasattr(f, 'help'):
#             f.help = lines
#         else:
#             f.help = lines + f.help
# 
#         return f
# 
#     return wrap


import logging
import requests
from twisted.internet import defer
from twisted.internet.threads import deferToThread
from cardinal.decorators import command, help

        return Forecast(
            location=location,
            condition=res['current']['condition']['text'],
            temperature_f=res['current']['temp_f'],
            humidity=res['current']['humidity'],
            winds_mph=res['current']['wind_mph'],
        )


class WeatherPlugin:
    def __init__(self, cardinal, config):
        self.logger = logging.getLogger(__name__)
        self.db = cardinal.get_db('weather')

        if config is None:
            config = {}

        self.provider = config.get('provider', 'weatherapi')
        self.api_key = config.get('api_key', None)

        if self.provider == 'openweather':
            self.client = OpenWeatherClient(self.api_key)
        elif self.provider == 'weatherapi':
            self.client = WeatherAPIClient(self.api_key)
        else:
            raise Exception(f"Unknown weather provider: {self.provider}")

    @command('setw')
    @help("Set your default weather location.")

# Path: cardinal/decorators.py
# def command(triggers):
#     if isinstance(triggers, str):
#         triggers = [triggers]
# 
#     if not isinstance(triggers, list):
#         raise TypeError("Command must be a trigger string or list of triggers")
# 
#     def wrap(f):
#         f.commands = triggers
#         return f
# 
#     return wrap
# 
# def help(lines):
#     # For backwards compatibility
#     if isinstance(lines, str):
#         lines = [lines]
# 
#     if not isinstance(lines, list):
#         raise TypeError("Help must be a help string or list of help strings")
# 
#     def wrap(f):
#         # Create help list or prepend to it
#         if not hasattr(f, 'help'):
#             f.help = lines
#         else:
#             f.help = lines + f.help
# 
#         return f
# 
#     return wrap


# Path: plugins/weather/plugin.py
import logging
import requests
from twisted.internet import defer
from twisted.internet.threads import deferToThread
from cardinal.decorators import command, help


        return Forecast(
            location=location,
            condition=res['current']['condition']['text'],
            temperature_f=res['current']['temp_f'],
            humidity=res['current']['humidity'],
            winds_mph=res['current']['wind_mph'],
        )


class WeatherPlugin:
    def __init__(self, cardinal, config):
        self.logger = logging.getLogger(__name__)
        self.db = cardinal.get_db('weather')

        if config is None:
            config = {}

        self.provider = config.get('provider', 'weatherapi')
        self.api_key = config.get('api_key', None)

        if self.provider == 'openweather':
            self.client = OpenWeatherClient(self.api_key)
        elif self.provider == 'weatherapi':
            self.client = WeatherAPIClient(self.api_key)
        else:
            raise Exception(f"Unknown weather provider: {self.provider}")

    @command('setw')
    @help("Set your default weather location.")

    @help("Syntax: .setw <location>")