<commit_before>const ISY = require('isy-js')
const QUEUE = require('queue')
const ISY_SETTINGS = require('js-yaml')
                     .safeLoad(require('fs')
                     .readFileSync(process.env.SETTINGS_FILE, 'utf8'))
                     .isy || {}

function processEvent (isyDevice) {
  console.log(`Processing event for ${isyDevice.deviceType} [${isyDevice.address}]`)
  Device.findTyped({ type: isyDevice.deviceType, address: isyDevice.address })
  .then(device => {
    device.sendSmartThingsUpdate()
  })
  .catch(err => {
    throw err
  })
}

module.exports = (sails) => {
  var connection
  var devices
  var eventQ

  function loadDevices () {
    var newDevices = {}
    connection.getDeviceList().forEach(device => {
      newDevices[device.address] = device
    })
    devices = newDevices
  }

  return {
    devices: () => {
      return Object.values(devices)
    },<commit_msg>Attempt to fix bug with unknown types<commit_after>const ISY = require('isy-js')
const QUEUE = require('queue')
const ISY_SETTINGS = require('js-yaml')
                     .safeLoad(require('fs')
                     .readFileSync(process.env.SETTINGS_FILE, 'utf8'))
                     .isy || {}

function processEvent (isyDevice) {
  var type = isyDevice.deviceType
  if (type === 'DimmableLight' || type === 'Fan' || type === 'Light' || type === 'Outlet' || type === 'Scene') {
    console.log(`Processing event for ${isyDevice.deviceType} [${isyDevice.address}]`)
    Device.findTyped({ type: isyDevice.deviceType, address: isyDevice.address })
    .then(device => {
      device.sendSmartThingsUpdate()
    })
    .catch(err => {
      throw err
    })
  } else {
    console.log(`Ignoring event for ${isyDevice.deviceType} [${isyDevice.address}]`)
  }
}

module.exports = (sails) => {
  var connection
  var devices
  var eventQ

  function loadDevices () {
    var newDevices = {}
    connection.getDeviceList().forEach(device => {
      newDevices[device.address] = device
    })
    devices = newDevices
  }

  return {
    devices: () => {
      return Object.values(devices)
    },
{'fraction_non_alphanumeric': 0.14740846409890632, 'fraction_numerical': 0.0009510223490252021, 'mean_word_length': 2.8185117967332123, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3550144', 'n_tokens_mistral': 655, 'n_tokens_neox': 642, 'n_words': 130}