Esempio n. 1
0
	def deleteRoom(self, buildingName, roomName):
		checkData(locals())

		print "\t\t\t\t\t\t\t\tTODO (" + self.__class__.__name__ + ":" + sys._getframe().f_code.co_name + ")  not yet tested"
		print "\t\t\t\t\t\t\t\tTODO (" + self.__class__.__name__ + ":" + sys._getframe().f_code.co_name + ")  table rules_priority not correctly updated"

		from app.backend.model.room import Room
		room = Room(roomName = roomName,  buildingName = buildingName)
		room.retrieve()

		ruleList = room.getRules()
		triggerList = room.getTriggers()
		actionList = room.getActions()

		for rule in ruleList:
			rule.delete()

		for trigger in triggerList:
			room.deleteTrigger(trigger)

		for action in actionList:
			room.deleteAction(action)

		room.delete()

		return {}
Esempio n. 2
0
	def getActions(self, roomName, buildingName):
		checkData(locals())

		room = Room(buildingName = buildingName, roomName = roomName)
		room.retrieve()

		actionList = room.getActions( )

		response = []
		for action in actionList:
			response.append(action.getDict())
			

		return {"actions" : response}