{"size": 530, "ext": "js", "max_stars_repo_path": "lib/device-manager-factory.js", "max_stars_repo_name": "giorgoxxi/automation-monitor", "max_stars_repo_stars_event_min_datetime": "2018-01-18T23:35:29.000Z", "max_stars_repo_stars_event_max_datetime": "2018-01-18T23:35:29.000Z", "max_issues_repo_path": "lib/device-manager-factory.js", "max_issues_repo_name": "giorgoxxi/automation-monitor", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/device-manager-factory.js", "max_forks_repo_name": "giorgoxxi/automation-monitor", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 29.4444444444, "max_line_length": 117, "alphanum_fraction": 0.6716981132}
const tplinkPlugManager = require('./device-managers/tplink-plug');

let DeviceManagerFactory = function(deviceName) {
    this.deviceManager = null;

    // Remove instance from device name
    deviceName = deviceName.substring(0, deviceName.indexOf('-') > -1 ? deviceName.indexOf('-') : deviceName.length);

    switch (deviceName){
        case 'tplinkplug':
            this.deviceManager = tplinkPlugManager;
            return;
    }
};

module.exports = (deviceName) => {
    return new DeviceManagerFactory(deviceName);
};