 						# Initialize the driver:
 						unless driverModule = require dirName + file.name
 							callback 'Couldn\'t find module', null
-						unless driverModule.add and driverModule.remove and driver.update and driver.init and driver.apply
+						unless isActuator = driverModule.isActuator or isSensor = driverModule.isSensor # or (!isActuator and !isSensor)
+							callback 'Driver not defining if for Sensors and/or Actuators', null
+							
+						unless driverModule.add and driverModule.remove and driver.update and driver.apply and (!isActuator or driver.init)
 							callback 'Driver not implementing the interface', null
 							
 						driverModule.init (err) ->


const DRIVERS_DIR = '../drivers/'

sensorsDrivers = null # List of drivers supported by the system - Must be set when server starts.
module.exports.setDrivers = (ref) -> sensorsDrivers = ref

module.exports = class Driver extends cozydb.CozyModel
	@schema:
		name: 		type : String		# not Empty
		
	
	###

								# If everything worked, save the Driver instance in DB:
								data =
									name: file.name
									isSensor: isSensor
									isActuator: isActuator
								superCreate data, (err, driver) ->
									if err
										callback 'Error saving the driver in DB', null
									else
										sensorsDrivers[driver.name] = driverModule if driver.isSensor
										actuatorsDrivers[driver.name] = driverModule if driver.isActuator
										callback null, driver
								