import { Ewelink } from './devices/ewelink';
import { Shelly } from './devices/shelly';
import { Base as device } from './devices/base';
import { Switch } from './types';
import { mqttWorker } from './services/mqttWorker';

export class Device
{
    protected device:device;

    constructor(mqttWorker:mqttWorker)
    {
        this.device = new Shelly(mqttWorker);
        //this.device = new Ewelink();
    }

    public async getStatus() : Promise<Switch>
    {
        return this.device.getStatus();
    }
    
    public async getPowerUsage() 
    {
        return this.device.getPowerUsage();
    }
    
    public async setState(state:Switch) : Promise<Switch> 
    {
        return this.device.setState(state);
    }
}